├── tdesignAPI ├── index.php ├── images │ ├── del.jpg │ ├── download │ ├── folder.png │ ├── preview.png │ ├── Images │ │ ├── bat.png │ │ ├── Cat_-1.png │ │ ├── Cat_-2.png │ │ ├── Cat_-3.png │ │ ├── Cat_-5.png │ │ ├── Cat_-6.png │ │ ├── Cat_-7.png │ │ ├── basket.png │ │ ├── flame1.png │ │ ├── mummy.png │ │ ├── Axe_001.png │ │ ├── Ghost_002.png │ │ ├── bujung24.png │ │ ├── car-logo.png │ │ ├── car-logo2.png │ │ ├── fantomme.png │ │ ├── race-car.png │ │ ├── 1279864510.png │ │ ├── 1280086312.png │ │ ├── 1280719313.png │ │ ├── 1280724056.png │ │ ├── 1281114733.png │ │ ├── 1284953487.png │ │ ├── angry_skull.png │ │ ├── beach_ball.png │ │ ├── grimreaper.png │ │ ├── plain_ghost.png │ │ ├── scary_ghost.png │ │ ├── Halloween_H_10.png │ │ ├── Halloween_H_4.png │ │ ├── Halloween_H_5.png │ │ ├── Halloween_H_6.png │ │ ├── Halloween_H_7.png │ │ ├── Halloween_H_8.png │ │ ├── Halloween_H_9.png │ │ ├── Pitchfork_Icon.png │ │ ├── black_cat_face.png │ │ ├── chequered-flag.png │ │ ├── javelin_throw.png │ │ ├── Halloween_Nails.png │ │ ├── ghost_under_hood.png │ │ ├── halloween_teeth.png │ │ ├── halloween_teeth2.png │ │ ├── feraliminal_skull.png │ │ ├── Anonymous_sports_car.png │ │ ├── kickboxer_silhouette.png │ │ ├── black-widow-spider-svg.png │ │ ├── Halloween_Spider_Web_Icon.png │ │ ├── baseball_player_silhouette.png │ │ ├── freestyle_soccer_silhouette.png │ │ └── cgbug_Halloween_Tombstone_Angry_Face.png │ ├── moveButton.png │ ├── menu_icons │ │ ├── art.png │ │ ├── tee.png │ │ ├── text.png │ │ ├── color_select.png │ │ ├── custom_icon.png │ │ └── submenu │ │ │ ├── tee.jpg │ │ │ └── hoodie.jpg │ └── product │ │ ├── tee │ │ ├── navy │ │ │ ├── navy_back.png │ │ │ └── navy_front.png │ │ ├── red │ │ │ ├── red_back.png │ │ │ └── red_front.png │ │ ├── black │ │ │ ├── black_back.png │ │ │ └── black_front.png │ │ ├── green │ │ │ ├── green_back.png │ │ │ └── green_front.png │ │ ├── royal │ │ │ ├── royal_back.png │ │ │ └── royal_front.png │ │ ├── white │ │ │ ├── white_back.png │ │ │ └── white_front.png │ │ └── purple │ │ │ ├── purple_back.png │ │ │ └── purple_front.png │ │ ├── hoodie │ │ ├── red │ │ │ ├── red_back.png │ │ │ └── red_front.png │ │ ├── black │ │ │ ├── black_back.png │ │ │ └── black_front.png │ │ ├── green │ │ │ ├── green_back.png │ │ │ └── green_front.png │ │ ├── navy │ │ │ ├── navy_back.png │ │ │ └── navy_front.png │ │ └── white │ │ │ ├── white_back.png │ │ │ └── white_front.png │ │ └── polo │ │ └── black │ │ ├── black_back.jpg │ │ └── black_front.jpg ├── orders │ ├── img_back.png │ └── img_front.png ├── css │ ├── main.css │ └── api.css ├── src │ ├── Font.js │ ├── Support.js │ ├── Util.js │ ├── Queue.js │ ├── Renderer.js │ ├── renderers │ │ ├── Canvas.js │ │ └── SVG.js │ ├── Preload.js │ ├── Core.js │ └── Generate.js ├── js │ ├── jquery.plugin.html2canvas.js │ ├── mainapp.js │ └── html2canvas.min.js └── new_applit.php ├── .settings └── com.aptana.editor.php.prefs ├── fonts ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff ├── classes ├── imgtobase64.php └── Input.php ├── core ├── init.php └── config.php ├── .gitattributes ├── .project ├── .gitignore ├── index.php ├── css ├── checkout.css └── normalize.css ├── README.md └── js ├── checkout.js └── bootstrap.min.js /tdesignAPI/index.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.settings/com.aptana.editor.php.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | phpVersion=php5.4 3 | -------------------------------------------------------------------------------- /tdesignAPI/images/del.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/del.jpg -------------------------------------------------------------------------------- /tdesignAPI/images/download: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/download -------------------------------------------------------------------------------- /tdesignAPI/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/folder.png -------------------------------------------------------------------------------- /tdesignAPI/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/preview.png -------------------------------------------------------------------------------- /tdesignAPI/orders/img_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/orders/img_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/bat.png -------------------------------------------------------------------------------- /tdesignAPI/images/moveButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/moveButton.png -------------------------------------------------------------------------------- /tdesignAPI/orders/img_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/orders/img_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Cat_-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Cat_-1.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Cat_-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Cat_-2.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Cat_-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Cat_-3.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Cat_-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Cat_-5.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Cat_-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Cat_-6.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Cat_-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Cat_-7.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/basket.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/flame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/flame1.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/mummy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/mummy.png -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Axe_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Axe_001.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Ghost_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Ghost_002.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/bujung24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/bujung24.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/car-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/car-logo.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/car-logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/car-logo2.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/fantomme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/fantomme.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/race-car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/race-car.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/art.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/tee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/tee.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/text.png -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /tdesignAPI/images/Images/1279864510.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/1279864510.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/1280086312.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/1280086312.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/1280719313.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/1280719313.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/1280724056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/1280724056.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/1281114733.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/1281114733.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/1284953487.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/1284953487.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/angry_skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/angry_skull.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/beach_ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/beach_ball.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/grimreaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/grimreaper.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/plain_ghost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/plain_ghost.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/scary_ghost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/scary_ghost.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_10.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_4.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_5.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_6.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_7.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_8.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_H_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_H_9.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Pitchfork_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Pitchfork_Icon.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/black_cat_face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/black_cat_face.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/chequered-flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/chequered-flag.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/javelin_throw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/javelin_throw.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_Nails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_Nails.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/ghost_under_hood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/ghost_under_hood.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/halloween_teeth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/halloween_teeth.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/halloween_teeth2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/halloween_teeth2.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/color_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/color_select.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/custom_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/custom_icon.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/submenu/tee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/submenu/tee.jpg -------------------------------------------------------------------------------- /tdesignAPI/images/Images/feraliminal_skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/feraliminal_skull.png -------------------------------------------------------------------------------- /tdesignAPI/images/menu_icons/submenu/hoodie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/menu_icons/submenu/hoodie.jpg -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/navy/navy_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/navy/navy_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/red/red_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/red/red_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/red/red_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/red/red_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Anonymous_sports_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Anonymous_sports_car.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/kickboxer_silhouette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/kickboxer_silhouette.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/red/red_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/red/red_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/red/red_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/red/red_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/black/black_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/black/black_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/green/green_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/green/green_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/navy/navy_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/navy/navy_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/royal/royal_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/royal/royal_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/white/white_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/white/white_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/black-widow-spider-svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/black-widow-spider-svg.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/black/black_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/black/black_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/green/green_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/green/green_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/navy/navy_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/navy/navy_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/navy/navy_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/navy/navy_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/white/white_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/white/white_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/polo/black/black_back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/polo/black/black_back.jpg -------------------------------------------------------------------------------- /tdesignAPI/images/product/polo/black/black_front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/polo/black/black_front.jpg -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/black/black_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/black/black_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/green/green_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/green/green_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/purple/purple_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/purple/purple_back.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/purple/purple_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/purple/purple_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/royal/royal_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/royal/royal_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/tee/white/white_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/tee/white/white_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/Halloween_Spider_Web_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/Halloween_Spider_Web_Icon.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/baseball_player_silhouette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/baseball_player_silhouette.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/black/black_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/black/black_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/green/green_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/green/green_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/product/hoodie/white/white_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/product/hoodie/white/white_front.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/freestyle_soccer_silhouette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/freestyle_soccer_silhouette.png -------------------------------------------------------------------------------- /tdesignAPI/images/Images/cgbug_Halloween_Tombstone_Angry_Face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wicklers/Tee-Designer/HEAD/tdesignAPI/images/Images/cgbug_Halloween_Tombstone_Angry_Face.png -------------------------------------------------------------------------------- /classes/imgtobase64.php: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /core/init.php: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /core/config.php: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /tdesignAPI/css/main.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background:#789a00; 3 | margin:0; 4 | } 5 | 6 | header{ 7 | width:100%; 8 | min-width:1080px; 9 | } 10 | header a{ 11 | text-decoration:none; 12 | } 13 | span#logout,span#login{ 14 | color:white; 15 | font-size:20px; 16 | cursor:pointer; 17 | position:absolute; 18 | top:20px; 19 | right:60px; 20 | } 21 | .main_content{ 22 | width:1080px; 23 | height:auto; 24 | //background:#973636; 25 | margin:0 auto 100px auto; 26 | } 27 | .message{ 28 | font-family:Permanent Marker; 29 | color:#acacac; 30 | font-size:24px; 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /classes/Input.php: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | TalkinTee 4 | 5 | 6 | 7 | 8 | 9 | com.aptana.editor.php.aptanaPhpBuilder 10 | 11 | 12 | 13 | 14 | com.aptana.ide.core.unifiedBuilder 15 | 16 | 17 | 18 | 19 | 20 | com.aptana.editor.php.phpNature 21 | com.aptana.projects.webnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must ends with two \r. 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | TalkInTee 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 34 |
35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /css/checkout.css: -------------------------------------------------------------------------------- 1 | body{ 2 | //background:url('../img/patternCO.png') #efefef; 3 | } 4 | .checkoutForm .container{ 5 | border-left:1px solid #dedede; 6 | border-right:1px solid #dedede; 7 | background:#F3F3F3; 8 | } 9 | .imgDisp{ 10 | background: white; 11 | 12 | padding:30px; 13 | border:5px solid #E3E3E3; 14 | 15 | } 16 | 17 | .table{ 18 | width:50%; 19 | margin:0 auto; 20 | } 21 | .tee_details{ 22 | 23 | margin-bottom:10px; 24 | } 25 | .checkoutForm{ 26 | margin-top:-20px; 27 | } 28 | .checkoutForm legend{ 29 | 30 | } 31 | .imgdiv{ 32 | border-right:1px solid #E3E3E3; 33 | 34 | } 35 | .imgdiv div{ 36 | background: #E3E3E3; 37 | } 38 | .detailsDiv{ 39 | padding: 0 10px; 40 | } 41 | 42 | #loading{ 43 | background:#fff; 44 | left:0px; 45 | opacity:0.7; 46 | display:none; 47 | z-index: 999; 48 | top:0px; 49 | width:100%; 50 | height:100%; 51 | position:fixed; 52 | 53 | } 54 | #loading img{ 55 | top:50%; 56 | left:50%; 57 | opacity:1.0; 58 | margin-top:-25px; 59 | margin-left:-25px; 60 | position:fixed; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | http://wicklers.github.io/Tee-Designer/ 2 | 3 | Demo: http://teedesigner.xp3.biz/ 4 | 5 | Tee-Designer 6 | ============ 7 | 8 | It is an javascript based open source application for designing tee-shirts or hoodies. 9 | 10 | Features: 11 | ======================== 12 | 1. You can customize the designs of hoodies and tee. 13 | 2. Currently 5 colour shades. 14 | 3. Few cliparts which can be resized and drag anywhere on the canvas. 15 | 4. Add your own text with various size and different fonts, bold and italic too. 16 | 5. Upload your own pictures from your PC just by clicking on browse button in upload section. 17 | 6. Just add any number of cliparts into the `Tee-Designer\tdesignAPI\images\Images\` directory, it will auto detect the images in that folder and show up on the running application after refreshing. 18 | 19 | How To Use : 20 | ================= 21 | 1. Copy the contents into your root directory of your project. 22 | 2. Rename the `index.php` to some other name of your choice let's say `mydesigner.php`. 23 | 3. Call `mydesigner.php` from any of your file(must be in the same directory as of mydesigner.php) using PHP or Javascript/Jquery or any other method of your choice. 24 | 4. THAT'S ALL. Enjoyyy. 25 | 26 | Upcoming Upgradations: 27 | ======================== 28 | 1. Better UI/UX. 29 | 2. Support rotation of cliparts and texts. 30 | 3. Better Documentation. 31 | 32 | Fork 33 | ==== 34 | Help grow this plugin by your contribution, if you are a developer. 35 | -------------------------------------------------------------------------------- /tdesignAPI/src/Font.js: -------------------------------------------------------------------------------- 1 | _html2canvas.Util.Font = (function () { 2 | 3 | var fontData = {}; 4 | 5 | return function(font, fontSize, doc) { 6 | if (fontData[font + "-" + fontSize] !== undefined) { 7 | return fontData[font + "-" + fontSize]; 8 | } 9 | 10 | var container = doc.createElement('div'), 11 | img = doc.createElement('img'), 12 | span = doc.createElement('span'), 13 | sampleText = 'Hidden Text', 14 | baseline, 15 | middle, 16 | metricsObj; 17 | 18 | container.style.visibility = "hidden"; 19 | container.style.fontFamily = font; 20 | container.style.fontSize = fontSize; 21 | container.style.margin = 0; 22 | container.style.padding = 0; 23 | 24 | doc.body.appendChild(container); 25 | 26 | // http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever (handtinywhite.gif) 27 | img.src = "data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs="; 28 | img.width = 1; 29 | img.height = 1; 30 | 31 | img.style.margin = 0; 32 | img.style.padding = 0; 33 | img.style.verticalAlign = "baseline"; 34 | 35 | span.style.fontFamily = font; 36 | span.style.fontSize = fontSize; 37 | span.style.margin = 0; 38 | span.style.padding = 0; 39 | 40 | span.appendChild(doc.createTextNode(sampleText)); 41 | container.appendChild(span); 42 | container.appendChild(img); 43 | baseline = (img.offsetTop - span.offsetTop) + 1; 44 | 45 | container.removeChild(span); 46 | container.appendChild(doc.createTextNode(sampleText)); 47 | 48 | container.style.lineHeight = "normal"; 49 | img.style.verticalAlign = "super"; 50 | 51 | middle = (img.offsetTop-container.offsetTop) + 1; 52 | metricsObj = { 53 | baseline: baseline, 54 | lineWidth: 1, 55 | middle: middle 56 | }; 57 | 58 | fontData[font + "-" + fontSize] = metricsObj; 59 | 60 | doc.body.removeChild(container); 61 | 62 | return metricsObj; 63 | }; 64 | })(); 65 | -------------------------------------------------------------------------------- /tdesignAPI/src/Support.js: -------------------------------------------------------------------------------- 1 | _html2canvas.Util.Support = function (options, doc) { 2 | 3 | function supportSVGRendering() { 4 | var img = new Image(), 5 | canvas = doc.createElement("canvas"), 6 | ctx = (canvas.getContext === undefined) ? false : canvas.getContext("2d"); 7 | if (ctx === false) { 8 | return false; 9 | } 10 | canvas.width = canvas.height = 10; 11 | img.src = [ 12 | "data:image/svg+xml,", 13 | "", 14 | "", 15 | "
", 16 | "sup", 17 | "
", 18 | "
", 19 | "
" 20 | ].join(""); 21 | try { 22 | ctx.drawImage(img, 0, 0); 23 | canvas.toDataURL(); 24 | } catch(e) { 25 | return false; 26 | } 27 | _html2canvas.Util.log('html2canvas: Parse: SVG powered rendering available'); 28 | return true; 29 | } 30 | 31 | // Test whether we can use ranges to measure bounding boxes 32 | // Opera doesn't provide valid bounds.height/bottom even though it supports the method. 33 | 34 | function supportRangeBounds() { 35 | var r, testElement, rangeBounds, rangeHeight, support = false; 36 | 37 | if (doc.createRange) { 38 | r = doc.createRange(); 39 | if (r.getBoundingClientRect) { 40 | testElement = doc.createElement('boundtest'); 41 | testElement.style.height = "123px"; 42 | testElement.style.display = "block"; 43 | doc.body.appendChild(testElement); 44 | 45 | r.selectNode(testElement); 46 | rangeBounds = r.getBoundingClientRect(); 47 | rangeHeight = rangeBounds.height; 48 | 49 | if (rangeHeight === 123) { 50 | support = true; 51 | } 52 | doc.body.removeChild(testElement); 53 | } 54 | } 55 | 56 | return support; 57 | } 58 | 59 | return { 60 | rangeBounds: supportRangeBounds(), 61 | svgRendering: options.svgRendering && supportSVGRendering() 62 | }; 63 | }; -------------------------------------------------------------------------------- /js/checkout.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | var options = { 3 | target: '#update', // target element(s) to be updated with server response 4 | beforeSubmit: showRequest, // pre-submit callback 5 | success: showResponsemsg, // post-submit callback 6 | url:'../control/add_order.php', 7 | type: 'post', 8 | }; 9 | 10 | $('#checkoutid').ajaxForm(options); 11 | 12 | }); 13 | 14 | function showRequest(formData, jqForm, options) { 15 | // formData is an array; here we use $.param to convert it to a string to display it 16 | // but the form plugin does this for you automatically when it submits the data 17 | var queryString = $.param(formData); 18 | //alert(queryString); 19 | // jqForm is a jQuery object encapsulating the form element. To access the 20 | // DOM element for the form do this: 21 | $('#loading').show(); 22 | // var formElement = jqForm[0]; 23 | // here we could return false to prevent the form from being submitted; 24 | // returning anything other than false will allow the form submit to continue 25 | return true; 26 | } 27 | 28 | // post-submit callback 29 | function showResponsemsg(responseText, statusText, xhr, $form) { 30 | // for normal html responses, the first argument to the success callback 31 | // is the XMLHttpRequest object's responseText property 32 | 33 | // if the ajaxForm method was passed an Options Object with the dataType 34 | // property set to 'xml' then the first argument to the success callback 35 | // is the XMLHttpRequest object's responseXML property 36 | 37 | //$('#update').fadeIn(); 38 | //$('.u_close').fadeIn(); 39 | //alert(); 40 | if(responseText==1){ 41 | window.location='http://localhost/TalkinTee/track/index.php'; 42 | 43 | } 44 | else{ 45 | $('#myModal').modal(); 46 | $('#loading').hide(); 47 | } 48 | // if the ajaxForm method was passed an Options Object with the dataType 49 | // property set to 'json' then the first argument to the success callback 50 | // is the json data object returned by the server 51 | //document.getElementById("email").value = responseText; 52 | //document.getElementById("email_f").value = responseText; 53 | return true; 54 | 55 | } 56 | -------------------------------------------------------------------------------- /tdesignAPI/src/Util.js: -------------------------------------------------------------------------------- 1 | window.html2canvas = function(elements, opts) { 2 | elements = (elements.length) ? elements : [elements]; 3 | var queue, 4 | canvas, 5 | options = { 6 | // general 7 | logging: false, 8 | elements: elements, 9 | background: "#fff", 10 | 11 | // preload options 12 | proxy: null, 13 | timeout: 0, // no timeout 14 | useCORS: false, // try to load images as CORS (where available), before falling back to proxy 15 | allowTaint: false, // whether to allow images to taint the canvas, won't need proxy if set to true 16 | 17 | // parse options 18 | svgRendering: false, // use svg powered rendering where available (FF11+) 19 | ignoreElements: "IFRAME|OBJECT|PARAM", 20 | useOverflow: true, 21 | letterRendering: false, 22 | chinese: false, 23 | 24 | // render options 25 | 26 | width: null, 27 | height: null, 28 | taintTest: true, // do a taint test with all images before applying to canvas 29 | renderer: "Canvas" 30 | }; 31 | 32 | options = _html2canvas.Util.Extend(opts, options); 33 | 34 | _html2canvas.logging = options.logging; 35 | options.complete = function( images ) { 36 | 37 | if (typeof options.onpreloaded === "function") { 38 | if ( options.onpreloaded( images ) === false ) { 39 | return; 40 | } 41 | } 42 | queue = _html2canvas.Parse( images, options ); 43 | 44 | if (typeof options.onparsed === "function") { 45 | if ( options.onparsed( queue ) === false ) { 46 | return; 47 | } 48 | } 49 | 50 | canvas = _html2canvas.Renderer( queue, options ); 51 | 52 | if (typeof options.onrendered === "function") { 53 | options.onrendered( canvas ); 54 | } 55 | 56 | 57 | }; 58 | 59 | // for pages without images, we still want this to be async, i.e. return methods before executing 60 | window.setTimeout( function(){ 61 | _html2canvas.Preload( options ); 62 | }, 0 ); 63 | 64 | return { 65 | render: function( queue, opts ) { 66 | return _html2canvas.Renderer( queue, _html2canvas.Util.Extend(opts, options) ); 67 | }, 68 | parse: function( images, opts ) { 69 | return _html2canvas.Parse( images, _html2canvas.Util.Extend(opts, options) ); 70 | }, 71 | preload: function( opts ) { 72 | return _html2canvas.Preload( _html2canvas.Util.Extend(opts, options) ); 73 | }, 74 | log: _html2canvas.Util.log 75 | }; 76 | }; 77 | 78 | window.html2canvas.log = _html2canvas.Util.log; // for renderers 79 | window.html2canvas.Renderer = { 80 | Canvas: undefined // We are assuming this will be used 81 | }; -------------------------------------------------------------------------------- /tdesignAPI/src/Queue.js: -------------------------------------------------------------------------------- 1 | function h2cRenderContext(width, height) { 2 | var storage = []; 3 | return { 4 | storage: storage, 5 | width: width, 6 | height: height, 7 | clip: function() { 8 | storage.push({ 9 | type: "function", 10 | name: "clip", 11 | 'arguments': arguments 12 | }); 13 | }, 14 | translate: function() { 15 | storage.push({ 16 | type: "function", 17 | name: "translate", 18 | 'arguments': arguments 19 | }); 20 | }, 21 | fill: function() { 22 | storage.push({ 23 | type: "function", 24 | name: "fill", 25 | 'arguments': arguments 26 | }); 27 | }, 28 | save: function() { 29 | storage.push({ 30 | type: "function", 31 | name: "save", 32 | 'arguments': arguments 33 | }); 34 | }, 35 | restore: function() { 36 | storage.push({ 37 | type: "function", 38 | name: "restore", 39 | 'arguments': arguments 40 | }); 41 | }, 42 | fillRect: function () { 43 | storage.push({ 44 | type: "function", 45 | name: "fillRect", 46 | 'arguments': arguments 47 | }); 48 | }, 49 | createPattern: function() { 50 | storage.push({ 51 | type: "function", 52 | name: "createPattern", 53 | 'arguments': arguments 54 | }); 55 | }, 56 | drawShape: function() { 57 | 58 | var shape = []; 59 | 60 | storage.push({ 61 | type: "function", 62 | name: "drawShape", 63 | 'arguments': shape 64 | }); 65 | 66 | return { 67 | moveTo: function() { 68 | shape.push({ 69 | name: "moveTo", 70 | 'arguments': arguments 71 | }); 72 | }, 73 | lineTo: function() { 74 | shape.push({ 75 | name: "lineTo", 76 | 'arguments': arguments 77 | }); 78 | }, 79 | arcTo: function() { 80 | shape.push({ 81 | name: "arcTo", 82 | 'arguments': arguments 83 | }); 84 | }, 85 | bezierCurveTo: function() { 86 | shape.push({ 87 | name: "bezierCurveTo", 88 | 'arguments': arguments 89 | }); 90 | }, 91 | quadraticCurveTo: function() { 92 | shape.push({ 93 | name: "quadraticCurveTo", 94 | 'arguments': arguments 95 | }); 96 | } 97 | }; 98 | 99 | }, 100 | drawImage: function () { 101 | storage.push({ 102 | type: "function", 103 | name: "drawImage", 104 | 'arguments': arguments 105 | }); 106 | }, 107 | fillText: function () { 108 | storage.push({ 109 | type: "function", 110 | name: "fillText", 111 | 'arguments': arguments 112 | }); 113 | }, 114 | setVariable: function (variable, value) { 115 | storage.push({ 116 | type: "variable", 117 | name: variable, 118 | 'arguments': value 119 | }); 120 | return value; 121 | } 122 | }; 123 | } -------------------------------------------------------------------------------- /tdesignAPI/js/jquery.plugin.html2canvas.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license html2canvas v0.34 3 | Copyright (c) 2011 Niklas von Hertzen. All rights reserved. 4 | http://www.twitter.com/niklasvh 5 | 6 | Released under MIT License 7 | */ 8 | /* 9 | * jQuery helper plugin for examples and tests 10 | */ 11 | (function( $ ){ 12 | $.fn.html2canvas = function(options) { 13 | if (options && options.profile && window.console && window.console.profile) { 14 | console.profile(); 15 | } 16 | var date = new Date(), 17 | html2obj, 18 | $message = null, 19 | timeoutTimer = false, 20 | timer = date.getTime(); 21 | options = options || {}; 22 | 23 | options.onrendered = options.onrendered || function( canvas ) { 24 | var $canvas = $(canvas), 25 | finishTime = new Date(); 26 | 27 | if (options && options.profile && window.console && window.console.profileEnd) { 28 | console.profileEnd(); 29 | } 30 | $canvas.css({ 31 | position: 'absolute', 32 | left: 0, 33 | top: 0 34 | }).appendTo(document.body); 35 | $canvas.siblings().toggle(); 36 | 37 | $(window).click(function(){ 38 | $canvas.toggle().siblings().toggle(); 39 | throwMessage("Canvas Render " + ($canvas.is(':visible') ? "visible" : "hidden")); 40 | }); 41 | throwMessage('Screenshot created in '+ ((finishTime.getTime()-timer)) + " ms
",4000); 42 | 43 | // test if canvas is read-able 44 | try { 45 | $canvas[0].toDataURL(); 46 | } catch(e) { 47 | if ($canvas[0].nodeName.toLowerCase() === "canvas") { 48 | // TODO, maybe add a bit less offensive way to present this, but still something that can easily be noticed 49 | alert("Canvas is tainted, unable to read data"); 50 | } 51 | } 52 | }; 53 | 54 | html2obj = html2canvas(this, options); 55 | 56 | function throwMessage(msg,duration){ 57 | window.clearTimeout(timeoutTimer); 58 | timeoutTimer = window.setTimeout(function(){ 59 | $message.fadeOut(function(){ 60 | $message.remove(); 61 | $message = null; 62 | }); 63 | },duration || 2000); 64 | if ($message) 65 | $message.remove(); 66 | $message = $('
').html(msg).css({ 67 | margin:0, 68 | padding:10, 69 | background: "#000", 70 | opacity:0.7, 71 | position:"fixed", 72 | top:10, 73 | right:10, 74 | fontFamily: 'Tahoma', 75 | color:'#fff', 76 | fontSize:12, 77 | borderRadius:12, 78 | width:'auto', 79 | height:'auto', 80 | textAlign:'center', 81 | textDecoration:'none', 82 | display:'none' 83 | }).appendTo(document.body).fadeIn(); 84 | html2obj.log(msg); 85 | } 86 | }; 87 | })( jQuery ); 88 | -------------------------------------------------------------------------------- /tdesignAPI/src/Renderer.js: -------------------------------------------------------------------------------- 1 | _html2canvas.Renderer = function(parseQueue, options){ 2 | 3 | // http://www.w3.org/TR/CSS21/zindex.html 4 | function createRenderQueue(parseQueue) { 5 | var queue = [], 6 | rootContext; 7 | 8 | rootContext = (function buildStackingContext(rootNode) { 9 | var rootContext = {}; 10 | function insert(context, node, specialParent) { 11 | var zi = (node.zIndex.zindex === 'auto') ? 0 : Number(node.zIndex.zindex), 12 | contextForChildren = context, // the stacking context for children 13 | isPositioned = node.zIndex.isPositioned, 14 | isFloated = node.zIndex.isFloated, 15 | stub = {node: node}, 16 | childrenDest = specialParent; // where children without z-index should be pushed into 17 | 18 | if (node.zIndex.ownStacking) { 19 | // '!' comes before numbers in sorted array 20 | contextForChildren = stub.context = { '!': [{node:node, children: []}]}; 21 | childrenDest = undefined; 22 | } else if (isPositioned || isFloated) { 23 | childrenDest = stub.children = []; 24 | } 25 | 26 | if (zi === 0 && specialParent) { 27 | specialParent.push(stub); 28 | } else { 29 | if (!context[zi]) { context[zi] = []; } 30 | context[zi].push(stub); 31 | } 32 | 33 | node.zIndex.children.forEach(function(childNode) { 34 | insert(contextForChildren, childNode, childrenDest); 35 | }); 36 | } 37 | insert(rootContext, rootNode); 38 | return rootContext; 39 | })(parseQueue); 40 | 41 | function sortZ(context) { 42 | Object.keys(context).sort().forEach(function(zi) { 43 | var nonPositioned = [], 44 | floated = [], 45 | positioned = [], 46 | list = []; 47 | 48 | // positioned after static 49 | context[zi].forEach(function(v) { 50 | if (v.node.zIndex.isPositioned || v.node.zIndex.opacity < 1) { 51 | // http://www.w3.org/TR/css3-color/#transparency 52 | // non-positioned element with opactiy < 1 should be stacked as if it were a positioned element with ‘z-index: 0’ and ‘opacity: 1’. 53 | positioned.push(v); 54 | } else if (v.node.zIndex.isFloated) { 55 | floated.push(v); 56 | } else { 57 | nonPositioned.push(v); 58 | } 59 | }); 60 | 61 | (function walk(arr) { 62 | arr.forEach(function(v) { 63 | list.push(v); 64 | if (v.children) { walk(v.children); } 65 | }); 66 | })(nonPositioned.concat(floated, positioned)); 67 | 68 | list.forEach(function(v) { 69 | if (v.context) { 70 | sortZ(v.context); 71 | } else { 72 | queue.push(v.node); 73 | } 74 | }); 75 | }); 76 | } 77 | 78 | sortZ(rootContext); 79 | 80 | return queue; 81 | } 82 | 83 | function getRenderer(rendererName) { 84 | var renderer; 85 | 86 | if (typeof options.renderer === "string" && _html2canvas.Renderer[rendererName] !== undefined) { 87 | renderer = _html2canvas.Renderer[rendererName](options); 88 | } else if (typeof rendererName === "function") { 89 | renderer = rendererName(options); 90 | } else { 91 | throw new Error("Unknown renderer"); 92 | } 93 | 94 | if ( typeof renderer !== "function" ) { 95 | throw new Error("Invalid renderer defined"); 96 | } 97 | return renderer; 98 | } 99 | 100 | return getRenderer(options.renderer)(parseQueue, options, document, createRenderQueue(parseQueue.stack), _html2canvas); 101 | }; 102 | -------------------------------------------------------------------------------- /tdesignAPI/src/renderers/Canvas.js: -------------------------------------------------------------------------------- 1 | _html2canvas.Renderer.Canvas = function(options) { 2 | options = options || {}; 3 | 4 | var doc = document, 5 | safeImages = [], 6 | testCanvas = document.createElement("canvas"), 7 | testctx = testCanvas.getContext("2d"), 8 | Util = _html2canvas.Util, 9 | canvas = options.canvas || doc.createElement('canvas'); 10 | 11 | function createShape(ctx, args) { 12 | ctx.beginPath(); 13 | args.forEach(function(arg) { 14 | ctx[arg.name].apply(ctx, arg['arguments']); 15 | }); 16 | ctx.closePath(); 17 | } 18 | 19 | function safeImage(item) { 20 | if (safeImages.indexOf(item['arguments'][0].src ) === -1) { 21 | testctx.drawImage(item['arguments'][0], 0, 0); 22 | try { 23 | testctx.getImageData(0, 0, 1, 1); 24 | } catch(e) { 25 | testCanvas = doc.createElement("canvas"); 26 | testctx = testCanvas.getContext("2d"); 27 | return false; 28 | } 29 | safeImages.push(item['arguments'][0].src); 30 | } 31 | return true; 32 | } 33 | 34 | function renderItem(ctx, item) { 35 | switch(item.type){ 36 | case "variable": 37 | ctx[item.name] = item['arguments']; 38 | break; 39 | case "function": 40 | switch(item.name) { 41 | case "createPattern": 42 | if (item['arguments'][0].width > 0 && item['arguments'][0].height > 0) { 43 | try { 44 | ctx.fillStyle = ctx.createPattern(item['arguments'][0], "repeat"); 45 | } 46 | catch(e) { 47 | Util.log("html2canvas: Renderer: Error creating pattern", e.message); 48 | } 49 | } 50 | break; 51 | case "drawShape": 52 | createShape(ctx, item['arguments']); 53 | break; 54 | case "drawImage": 55 | if (item['arguments'][8] > 0 && item['arguments'][7] > 0) { 56 | if (!options.taintTest || (options.taintTest && safeImage(item))) { 57 | ctx.drawImage.apply( ctx, item['arguments'] ); 58 | } 59 | } 60 | break; 61 | default: 62 | ctx[item.name].apply(ctx, item['arguments']); 63 | } 64 | break; 65 | } 66 | } 67 | 68 | return function(parsedData, options, document, queue, _html2canvas) { 69 | var ctx = canvas.getContext("2d"), 70 | newCanvas, 71 | bounds, 72 | fstyle, 73 | zStack = parsedData.stack; 74 | 75 | canvas.width = canvas.style.width = options.width || zStack.ctx.width; 76 | canvas.height = canvas.style.height = options.height || zStack.ctx.height; 77 | 78 | fstyle = ctx.fillStyle; 79 | ctx.fillStyle = (Util.isTransparent(zStack.backgroundColor) && options.background !== undefined) ? options.background : parsedData.backgroundColor; 80 | ctx.fillRect(0, 0, canvas.width, canvas.height); 81 | ctx.fillStyle = fstyle; 82 | 83 | queue.forEach(function(storageContext) { 84 | // set common settings for canvas 85 | ctx.textBaseline = "bottom"; 86 | ctx.save(); 87 | 88 | if (storageContext.transform.matrix) { 89 | ctx.translate(storageContext.transform.origin[0], storageContext.transform.origin[1]); 90 | ctx.transform.apply(ctx, storageContext.transform.matrix); 91 | ctx.translate(-storageContext.transform.origin[0], -storageContext.transform.origin[1]); 92 | } 93 | 94 | if (storageContext.clip){ 95 | ctx.beginPath(); 96 | ctx.rect(storageContext.clip.left, storageContext.clip.top, storageContext.clip.width, storageContext.clip.height); 97 | ctx.clip(); 98 | } 99 | 100 | if (storageContext.ctx.storage) { 101 | storageContext.ctx.storage.forEach(function(item) { 102 | renderItem(ctx, item); 103 | }); 104 | } 105 | 106 | ctx.restore(); 107 | }); 108 | 109 | Util.log("html2canvas: Renderer: Canvas renderer done - returning canvas obj"); 110 | 111 | if (options.elements.length === 1) { 112 | if (typeof options.elements[0] === "object" && options.elements[0].nodeName !== "BODY") { 113 | // crop image to the bounds of selected (single) element 114 | bounds = _html2canvas.Util.Bounds(options.elements[0]); 115 | newCanvas = document.createElement('canvas'); 116 | newCanvas.width = Math.ceil(bounds.width); 117 | newCanvas.height = Math.ceil(bounds.height); 118 | ctx = newCanvas.getContext("2d"); 119 | 120 | ctx.drawImage(canvas, bounds.left, bounds.top, bounds.width, bounds.height, 0, 0, bounds.width, bounds.height); 121 | canvas = null; 122 | return newCanvas; 123 | } 124 | } 125 | 126 | return canvas; 127 | }; 128 | }; -------------------------------------------------------------------------------- /tdesignAPI/src/renderers/SVG.js: -------------------------------------------------------------------------------- 1 | /* 2 | html2canvas @VERSION@ 3 | Copyright (c) 2011 Niklas von Hertzen. All rights reserved. 4 | http://www.twitter.com/niklasvh 5 | 6 | Released under MIT License 7 | */ 8 | 9 | 10 | // WARNING THIS file is outdated, and hasn't been tested in quite a while 11 | 12 | _html2canvas.Renderer.SVG = function( options ) { 13 | 14 | options = options || {}; 15 | 16 | var doc = document, 17 | svgNS = "http://www.w3.org/2000/svg", 18 | svg = doc.createElementNS(svgNS, "svg"), 19 | xlinkNS = "http://www.w3.org/1999/xlink", 20 | defs = doc.createElementNS(svgNS, "defs"), 21 | i, 22 | a, 23 | queueLen, 24 | storageLen, 25 | storageContext, 26 | renderItem, 27 | el, 28 | settings = {}, 29 | text, 30 | fontStyle, 31 | clipId = 0, 32 | methods; 33 | 34 | 35 | methods = { 36 | _create: function( zStack, options, doc, queue, _html2canvas ) { 37 | svg.setAttribute("version", "1.1"); 38 | svg.setAttribute("baseProfile", "full"); 39 | 40 | svg.setAttribute("viewBox", "0 0 " + Math.max(zStack.ctx.width, options.width) + " " + Math.max(zStack.ctx.height, options.height)); 41 | svg.setAttribute("width", Math.max(zStack.ctx.width, options.width) + "px"); 42 | svg.setAttribute("height", Math.max(zStack.ctx.height, options.height) + "px"); 43 | svg.setAttribute("preserveAspectRatio", "none"); 44 | svg.appendChild(defs); 45 | 46 | 47 | 48 | for (i = 0, queueLen = queue.length; i < queueLen; i+=1){ 49 | 50 | storageContext = queue.splice(0, 1)[0]; 51 | storageContext.canvasPosition = storageContext.canvasPosition || {}; 52 | 53 | //this.canvasRenderContext(storageContext,parentctx); 54 | 55 | 56 | /* 57 | if (storageContext.clip){ 58 | ctx.save(); 59 | ctx.beginPath(); 60 | // console.log(storageContext); 61 | ctx.rect(storageContext.clip.left, storageContext.clip.top, storageContext.clip.width, storageContext.clip.height); 62 | ctx.clip(); 63 | 64 | }*/ 65 | 66 | if (storageContext.ctx.storage){ 67 | 68 | for (a = 0, storageLen = storageContext.ctx.storage.length; a < storageLen; a+=1){ 69 | 70 | renderItem = storageContext.ctx.storage[a]; 71 | 72 | 73 | 74 | switch(renderItem.type){ 75 | case "variable": 76 | settings[renderItem.name] = renderItem['arguments']; 77 | break; 78 | case "function": 79 | if (renderItem.name === "fillRect") { 80 | 81 | el = doc.createElementNS(svgNS, "rect"); 82 | el.setAttribute("x", renderItem['arguments'][0]); 83 | el.setAttribute("y", renderItem['arguments'][1]); 84 | el.setAttribute("width", renderItem['arguments'][2]); 85 | el.setAttribute("height", renderItem['arguments'][3]); 86 | el.setAttribute("fill", settings.fillStyle); 87 | svg.appendChild(el); 88 | 89 | } else if(renderItem.name === "fillText") { 90 | el = doc.createElementNS(svgNS, "text"); 91 | 92 | fontStyle = settings.font.split(" "); 93 | 94 | el.style.fontVariant = fontStyle.splice(0, 1)[0]; 95 | el.style.fontWeight = fontStyle.splice(0, 1)[0]; 96 | el.style.fontStyle = fontStyle.splice(0, 1)[0]; 97 | el.style.fontSize = fontStyle.splice(0, 1)[0]; 98 | 99 | el.setAttribute("x", renderItem['arguments'][1]); 100 | el.setAttribute("y", renderItem['arguments'][2] - (parseInt(el.style.fontSize, 10) + 3)); 101 | 102 | el.setAttribute("fill", settings.fillStyle); 103 | 104 | 105 | 106 | 107 | // TODO get proper baseline 108 | el.style.dominantBaseline = "text-before-edge"; 109 | el.style.fontFamily = fontStyle.join(" "); 110 | 111 | text = doc.createTextNode(renderItem['arguments'][0]); 112 | el.appendChild(text); 113 | 114 | 115 | svg.appendChild(el); 116 | 117 | 118 | 119 | } else if(renderItem.name === "drawImage") { 120 | 121 | if (renderItem['arguments'][8] > 0 && renderItem['arguments'][7]){ 122 | 123 | // TODO check whether even any clipping is necessary for this particular image 124 | el = doc.createElementNS(svgNS, "clipPath"); 125 | el.setAttribute("id", "clipId" + clipId); 126 | 127 | text = doc.createElementNS(svgNS, "rect"); 128 | text.setAttribute("x", renderItem['arguments'][5] ); 129 | text.setAttribute("y", renderItem['arguments'][6]); 130 | 131 | text.setAttribute("width", renderItem['arguments'][3]); 132 | text.setAttribute("height", renderItem['arguments'][4]); 133 | el.appendChild(text); 134 | defs.appendChild(el); 135 | 136 | el = doc.createElementNS(svgNS, "image"); 137 | el.setAttributeNS(xlinkNS, "xlink:href", renderItem['arguments'][0].src); 138 | el.setAttribute("width", renderItem['arguments'][7]); 139 | el.setAttribute("height", renderItem['arguments'][8]); 140 | el.setAttribute("x", renderItem['arguments'][5]); 141 | el.setAttribute("y", renderItem['arguments'][6]); 142 | el.setAttribute("clip-path", "url(#clipId" + clipId + ")"); 143 | // el.setAttribute("xlink:href", ); 144 | 145 | 146 | el.setAttribute("preserveAspectRatio", "none"); 147 | 148 | svg.appendChild(el); 149 | 150 | 151 | clipId += 1; 152 | /* 153 | ctx.drawImage( 154 | renderItem['arguments'][0], 155 | renderItem['arguments'][1], 156 | renderItem['arguments'][2], 157 | renderItem['arguments'][3], 158 | renderItem['arguments'][4], 159 | renderItem['arguments'][5], 160 | renderItem['arguments'][6], 161 | renderItem['arguments'][7], 162 | renderItem['arguments'][8] 163 | ); 164 | */ 165 | } 166 | } 167 | 168 | 169 | 170 | break; 171 | default: 172 | 173 | } 174 | 175 | } 176 | 177 | } 178 | /* 179 | if (storageContext.clip){ 180 | ctx.restore(); 181 | } 182 | */ 183 | 184 | 185 | 186 | } 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | _html2canvas.Util.log("html2canvas: Renderer: SVG Renderer done - returning SVG DOM obj"); 198 | 199 | return svg; 200 | } 201 | }; 202 | 203 | return methods; 204 | 205 | 206 | }; 207 | -------------------------------------------------------------------------------- /css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. 29 | * Correct `block` display not defined for `main` in IE 11. 30 | */ 31 | 32 | article, 33 | aside, 34 | details, 35 | figcaption, 36 | figure, 37 | footer, 38 | header, 39 | hgroup, 40 | main, 41 | nav, 42 | section, 43 | summary { 44 | display: block; 45 | } 46 | 47 | /** 48 | * 1. Correct `inline-block` display not defined in IE 8/9. 49 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 50 | */ 51 | 52 | audio, 53 | canvas, 54 | progress, 55 | video { 56 | display: inline-block; /* 1 */ 57 | vertical-align: baseline; /* 2 */ 58 | } 59 | 60 | /** 61 | * Prevent modern browsers from displaying `audio` without controls. 62 | * Remove excess height in iOS 5 devices. 63 | */ 64 | 65 | audio:not([controls]) { 66 | display: none; 67 | height: 0; 68 | } 69 | 70 | /** 71 | * Address `[hidden]` styling not present in IE 8/9/10. 72 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 73 | */ 74 | 75 | [hidden], 76 | template { 77 | display: none; 78 | } 79 | 80 | /* Links 81 | ========================================================================== */ 82 | 83 | /** 84 | * Remove the gray background color from active links in IE 10. 85 | */ 86 | 87 | a { 88 | background: transparent; 89 | } 90 | 91 | /** 92 | * Improve readability when focused and also mouse hovered in all browsers. 93 | */ 94 | 95 | a:active, 96 | a:hover { 97 | outline: 0; 98 | } 99 | 100 | /* Text-level semantics 101 | ========================================================================== */ 102 | 103 | /** 104 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 105 | */ 106 | 107 | abbr[title] { 108 | border-bottom: 1px dotted; 109 | } 110 | 111 | /** 112 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 113 | */ 114 | 115 | b, 116 | strong { 117 | font-weight: bold; 118 | } 119 | 120 | /** 121 | * Address styling not present in Safari and Chrome. 122 | */ 123 | 124 | dfn { 125 | font-style: italic; 126 | } 127 | 128 | /** 129 | * Address variable `h1` font-size and margin within `section` and `article` 130 | * contexts in Firefox 4+, Safari, and Chrome. 131 | */ 132 | 133 | h1 { 134 | font-size: 2em; 135 | margin: 0.67em 0; 136 | } 137 | 138 | /** 139 | * Address styling not present in IE 8/9. 140 | */ 141 | 142 | mark { 143 | background: #ff0; 144 | color: #000; 145 | } 146 | 147 | /** 148 | * Address inconsistent and variable font size in all browsers. 149 | */ 150 | 151 | small { 152 | font-size: 80%; 153 | } 154 | 155 | /** 156 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 157 | */ 158 | 159 | sub, 160 | sup { 161 | font-size: 75%; 162 | line-height: 0; 163 | position: relative; 164 | vertical-align: baseline; 165 | } 166 | 167 | sup { 168 | top: -0.5em; 169 | } 170 | 171 | sub { 172 | bottom: -0.25em; 173 | } 174 | 175 | /* Embedded content 176 | ========================================================================== */ 177 | 178 | /** 179 | * Remove border when inside `a` element in IE 8/9/10. 180 | */ 181 | 182 | img { 183 | border: 0; 184 | } 185 | 186 | /** 187 | * Correct overflow not hidden in IE 9/10/11. 188 | */ 189 | 190 | svg:not(:root) { 191 | overflow: hidden; 192 | } 193 | 194 | /* Grouping content 195 | ========================================================================== */ 196 | 197 | /** 198 | * Address margin not present in IE 8/9 and Safari. 199 | */ 200 | 201 | figure { 202 | margin: 1em 40px; 203 | } 204 | 205 | /** 206 | * Address differences between Firefox and other browsers. 207 | */ 208 | 209 | hr { 210 | -moz-box-sizing: content-box; 211 | box-sizing: content-box; 212 | height: 0; 213 | } 214 | 215 | /** 216 | * Contain overflow in all browsers. 217 | */ 218 | 219 | pre { 220 | overflow: auto; 221 | } 222 | 223 | /** 224 | * Address odd `em`-unit font size rendering in all browsers. 225 | */ 226 | 227 | code, 228 | kbd, 229 | pre, 230 | samp { 231 | font-family: monospace, monospace; 232 | font-size: 1em; 233 | } 234 | 235 | /* Forms 236 | ========================================================================== */ 237 | 238 | /** 239 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 240 | * styling of `select`, unless a `border` property is set. 241 | */ 242 | 243 | /** 244 | * 1. Correct color not being inherited. 245 | * Known issue: affects color of disabled elements. 246 | * 2. Correct font properties not being inherited. 247 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 248 | */ 249 | 250 | button, 251 | input, 252 | optgroup, 253 | select, 254 | textarea { 255 | color: inherit; /* 1 */ 256 | font: inherit; /* 2 */ 257 | margin: 0; /* 3 */ 258 | } 259 | 260 | /** 261 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 262 | */ 263 | 264 | button { 265 | overflow: visible; 266 | } 267 | 268 | /** 269 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 270 | * All other form control elements do not inherit `text-transform` values. 271 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 272 | * Correct `select` style inheritance in Firefox. 273 | */ 274 | 275 | button, 276 | select { 277 | text-transform: none; 278 | } 279 | 280 | /** 281 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 282 | * and `video` controls. 283 | * 2. Correct inability to style clickable `input` types in iOS. 284 | * 3. Improve usability and consistency of cursor style between image-type 285 | * `input` and others. 286 | */ 287 | 288 | button, 289 | html input[type="button"], /* 1 */ 290 | input[type="reset"], 291 | input[type="submit"] { 292 | -webkit-appearance: button; /* 2 */ 293 | cursor: pointer; /* 3 */ 294 | } 295 | 296 | /** 297 | * Re-set default cursor for disabled elements. 298 | */ 299 | 300 | button[disabled], 301 | html input[disabled] { 302 | cursor: default; 303 | } 304 | 305 | /** 306 | * Remove inner padding and border in Firefox 4+. 307 | */ 308 | 309 | button::-moz-focus-inner, 310 | input::-moz-focus-inner { 311 | border: 0; 312 | padding: 0; 313 | } 314 | 315 | /** 316 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 317 | * the UA stylesheet. 318 | */ 319 | 320 | input { 321 | line-height: normal; 322 | } 323 | 324 | /** 325 | * It's recommended that you don't attempt to style these elements. 326 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 327 | * 328 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 329 | * 2. Remove excess padding in IE 8/9/10. 330 | */ 331 | 332 | input[type="checkbox"], 333 | input[type="radio"] { 334 | box-sizing: border-box; /* 1 */ 335 | padding: 0; /* 2 */ 336 | } 337 | 338 | /** 339 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 340 | * `font-size` values of the `input`, it causes the cursor style of the 341 | * decrement button to change from `default` to `text`. 342 | */ 343 | 344 | input[type="number"]::-webkit-inner-spin-button, 345 | input[type="number"]::-webkit-outer-spin-button { 346 | height: auto; 347 | } 348 | 349 | /** 350 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 351 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 352 | * (include `-moz` to future-proof). 353 | */ 354 | 355 | input[type="search"] { 356 | -webkit-appearance: textfield; /* 1 */ 357 | -moz-box-sizing: content-box; 358 | -webkit-box-sizing: content-box; /* 2 */ 359 | box-sizing: content-box; 360 | } 361 | 362 | /** 363 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 364 | * Safari (but not Chrome) clips the cancel button when the search input has 365 | * padding (and `textfield` appearance). 366 | */ 367 | 368 | input[type="search"]::-webkit-search-cancel-button, 369 | input[type="search"]::-webkit-search-decoration { 370 | -webkit-appearance: none; 371 | } 372 | 373 | /** 374 | * Define consistent border, margin, and padding. 375 | */ 376 | 377 | fieldset { 378 | border: 1px solid #c0c0c0; 379 | margin: 0 2px; 380 | padding: 0.35em 0.625em 0.75em; 381 | } 382 | 383 | /** 384 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 385 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 386 | */ 387 | 388 | legend { 389 | border: 0; /* 1 */ 390 | padding: 0; /* 2 */ 391 | } 392 | 393 | /** 394 | * Remove default vertical scrollbar in IE 8/9/10/11. 395 | */ 396 | 397 | textarea { 398 | overflow: auto; 399 | } 400 | 401 | /** 402 | * Don't inherit the `font-weight` (applied by a rule above). 403 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 404 | */ 405 | 406 | optgroup { 407 | font-weight: bold; 408 | } 409 | 410 | /* Tables 411 | ========================================================================== */ 412 | 413 | /** 414 | * Remove most spacing between table cells. 415 | */ 416 | 417 | table { 418 | border-collapse: collapse; 419 | border-spacing: 0; 420 | } 421 | 422 | td, 423 | th { 424 | padding: 0; 425 | } -------------------------------------------------------------------------------- /tdesignAPI/css/api.css: -------------------------------------------------------------------------------- 1 | body{ 2 | 3 | min-height:1200px; 4 | } 5 | .design_api_container{ 6 | min-height:1000px; 7 | } 8 | span.glyphicon { 9 | font-size: 3em; 10 | } 11 | .design_api{ 12 | width:968px; 13 | height:530px; 14 | //background:#fcfcfc; 15 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAHklEQVQYV2NkYGDwAWKCgJGgCogCn1GF+EKK+OABADvrAwPdMEGvAAAAAElFTkSuQmCC); 16 | //padding:10px 0px; 17 | //border:1px solid #3c3c3c; 18 | } 19 | #menu,#options,#preview_t,#view_mode,#overview{ 20 | float:left; 21 | //border:1px solid #000; 22 | } 23 | .bold_text{ 24 | font-weight:bold; 25 | } 26 | .italic_text{ 27 | font-style:italic; 28 | } 29 | .underline_text{ 30 | text-decoration:underline; 31 | } 32 | .shadow{ 33 | box-shadow:0 0 10px inset #3c3c3c; 34 | } 35 | /*======================MENU=============================*/ 36 | #menu{ 37 | width:53px; 38 | height:530px; 39 | background:#62AED4; 40 | } 41 | .menu_option{ 42 | width:53px; 43 | height:53px; 44 | border:5px solid transparent; 45 | background:#62AED4; 46 | cursor:pointer; 47 | 48 | } 49 | .menu_option:hover{ 50 | //background:#AE9EDE; 51 | } 52 | .sel_type{ 53 | background:url(../images/menu_icons/tee.png) no-repeat; 54 | background-size:42px 42px; 55 | } 56 | .sel_type:hover{ 57 | background:url(../images/menu_icons/tee.png) #83CBEE no-repeat; 58 | background-size:42px 42px; 59 | } 60 | 61 | .sel_color:hover{ 62 | background:#83CBEE; 63 | } 64 | 65 | .sel_art:hover{ 66 | background:#83CBEE; 67 | } 68 | 69 | .sel_custom_icon:hover{ 70 | background:#83CBEE; 71 | } 72 | .sel_text:hover{ 73 | background:#83CBEE; 74 | 75 | } 76 | 77 | 78 | /*======================subMENU 1=============================*/ 79 | 80 | /*======================subMENU 1 over=============================*/ 81 | /*======================MENU OVER=============================*/ 82 | /*======================OPTIONS=============================*/ 83 | #options{ 84 | width:180px; 85 | height:530px; 86 | //padding:5px; 87 | //border-right:1px solid #9c9c9c; 88 | background:#cecece; 89 | } 90 | .T_type{ 91 | width:180px; 92 | height:100%; 93 | background:#cecece; 94 | 95 | 96 | } 97 | .T_type div{ 98 | width:82px; 99 | height:85px; 100 | float:left; 101 | cursor:pointer; 102 | margin:2px; 103 | } 104 | 105 | 106 | .color_pick{ 107 | width:180px; 108 | height:40px; 109 | background:#aaa; 110 | } 111 | .color_radio_div{ 112 | height:30px; 113 | width:30px; 114 | float:left; 115 | display:inline; 116 | margin:2px; 117 | 118 | } 119 | 120 | #red{ 121 | background:red; 122 | cursor:pointer; 123 | } 124 | #black{ 125 | background:black; 126 | cursor:pointer; 127 | } 128 | #white{ 129 | background:white; 130 | cursor:pointer; 131 | } 132 | #green{ 133 | background:green; 134 | cursor:pointer; 135 | } 136 | #navy{ 137 | background:navy; 138 | cursor:pointer; 139 | } 140 | 141 | .default_samples{ 142 | 143 | width:180px; 144 | height:520px; 145 | border:1px solid #acacac; 146 | background:#f1f1f1; 147 | overflow-y:scroll 148 | } 149 | .default_samples::-webkit-scrollbar{ 150 | width:8px; 151 | background-color:#cccccc; 152 | } 153 | .default_samples::-webkit-scrollbar-thumb{ 154 | background-color:#acacac; 155 | border-radius:4px; 156 | } 157 | .default_samples::-webkit-scrollbar-thumb:hover{ 158 | background-color:#9c9c9c; 159 | border-radius:4px; 160 | } 161 | .sample_icons,.dir_icons{ 162 | width:50px; 163 | height:50px; 164 | cursor:pointer; 165 | padding:2px; 166 | float:left; 167 | box-shadow: 0 0 5px transparent; 168 | } 169 | .sample_icons:hover{ 170 | box-shadow: 0 0 5px #acacac; 171 | 172 | } 173 | .dir_icons{ 174 | width:100%; 175 | height:auto; 176 | box-shadow: 0 0 5px transparent; 177 | border-top:#CCCCCC 1px solid; 178 | border-bottom:#CCCCCC 1px solid; 179 | } 180 | .dir_icons:hover{ 181 | box-shadow: 0 0 5px #acacac; 182 | } 183 | 184 | div.upload { 185 | width: 178px; 186 | height: 30px; 187 | background: grey; 188 | overflow: hidden; 189 | 190 | } 191 | 192 | div.upload input { 193 | display: block !important; 194 | width: 178px !important; 195 | height: 30px !important; 196 | opacity: 0 !important; 197 | overflow: hidden !important; 198 | cursor:pointer; 199 | } 200 | .custom_font{ 201 | background:#acacac; 202 | width:180px; 203 | height:100px; 204 | } 205 | .custom_font textarea{ 206 | width:180px; 207 | height:auto; 208 | min-height:120px; 209 | max-height:220px; 210 | resize:none; 211 | } 212 | .new_icon,.new_text{ 213 | cursor:move; 214 | position:absolute; 215 | 216 | border:1px solid transparent; 217 | height:60px; 218 | width:100px; 219 | padding:5px 5px 0 0; 220 | } 221 | .new_icon .property_icon,.new_text .property_icon{ 222 | display:none; 223 | } 224 | 225 | .new_icon:hover,.new_text:hover,.new_icon:active,.new_text:active{ 226 | border:1px solid #777; 227 | } 228 | #fs{ 229 | width:100px; 230 | } 231 | 232 | .font_styling{ 233 | width:180px; 234 | height:24px; 235 | background:grey; 236 | 237 | } 238 | 239 | .font_styling span{ 240 | border:1px solid #3c3c3c; 241 | height:20px; 242 | width:20px; 243 | margin:2px; 244 | display:block; 245 | float:left; 246 | cursor:pointer; 247 | background:#e1e1e1; 248 | text-align:center; 249 | } 250 | 251 | .font_styling span:hover{ 252 | background:#c1c1c1; 253 | box-shadow:0 0 5px #acacac; 254 | } 255 | .Text_input{ 256 | border:1px solid #9c9c9c; 257 | height:auto; 258 | width:auto; 259 | } 260 | 261 | /*======================OPTIONS Ends=============================*/ 262 | /*======================PREVIEW=============================*/ 263 | 264 | #preview_t{ 265 | width:495px; 266 | height:530px; 267 | //padding:5px; 268 | display:inline; 269 | overflow:hidden; 270 | border-bottom:1px solid #acacac; 271 | border-top:1px solid #acacac; 272 | } 273 | #preview_front,#preview_back{ 274 | height:510px; 275 | width:480px; 276 | background-repeat:no-repeat; 277 | background-size:480px 510px; 278 | 279 | margin:5px; 280 | } 281 | .dis_none{ 282 | display:none; 283 | -webkit-transition: all 0.5s ease; 284 | -moz-transition: all 0.5s ease; 285 | -o-transition: all 0.5s ease; 286 | transition: all 0.5s ease; 287 | } 288 | .front_print,.back_print{ 289 | width:470px; 290 | height:500px; 291 | //border:1px solid #acacac; 292 | position:absolute; 293 | padding:5px; 294 | } 295 | .delete_icon,.delete_text,.drag_text{ 296 | background:green; 297 | height:20px; 298 | width:20px; 299 | display:block; 300 | cursor:pointer; 301 | position:absolute; 302 | top:-12px; 303 | border-radius:5px; 304 | -webkit-transition: all 0.3s; 305 | -ms-transition: all 0.3s; 306 | -o-transition: all 0.3s; 307 | -moz-transition: all 0.3s; 308 | transition: all 0.3s; 309 | } 310 | .delete_icon,.delete_text{ 311 | right:-12px; 312 | background-image:url(../images/del.jpg); 313 | background-size:20px 20px; 314 | } 315 | .drag_text{ 316 | background:blue; 317 | left:-12px; 318 | } 319 | .delete_icon:hover,.delete_text:hover,.drag_text:hover{ 320 | box-shadow:0 0 5px #4c4c4c; 321 | top:-10px; 322 | right:-10px; 323 | 324 | } 325 | .drag_text{ 326 | background-image:url(../images/moveButton.png); 327 | background-size:20px 20px; 328 | } 329 | #text_style{ 330 | background:none; 331 | border:none; 332 | width:inherit; 333 | height:inherit; 334 | resize:none; 335 | overflow:hidden; 336 | } 337 | /*======================PREVIEW Ends=============================*/ 338 | /*======================VIEW MODE=============================*/ 339 | 340 | #view_mode{ 341 | width:60px; 342 | height:530px; 343 | 344 | //border-left:1px solid #9c9c9c; 345 | background:#62AED4; 346 | 347 | } 348 | #view_mode div{ 349 | width:60px; 350 | height:80px; 351 | margin-bottom:5px; 352 | padding:3px; 353 | //border:1px solid #3c3c3c; 354 | cursor:pointer; 355 | font-size:12px; 356 | text-align:center; 357 | 358 | } 359 | #view_mode div:hover{ 360 | background:#83CBEE; 361 | 362 | } 363 | #preview_images{ 364 | padding-top:5px; 365 | height:60px; 366 | } 367 | /*======================VIEW MODE Ends=============================*/ 368 | /*======================Overview=============================*/ 369 | 370 | #overview{ 371 | width:180px; 372 | height:530px; 373 | border-bottom:1px solid #acacac; 374 | border-top:1px solid #acacac; 375 | border-right:1px solid #acacac; 376 | background:#D7D7D7; 377 | padding:5px; 378 | } 379 | 380 | /*======================Overview Ends=============================*/ 381 | 382 | /*=======================detailing================================*/ 383 | /* 384 | #image_reply{ 385 | width:1000px; 386 | height:550px; 387 | margin:20px auto; 388 | padding:10px; 389 | background:white; 390 | border:1px solid #9c9c9c; 391 | border-radius:10px; 392 | border-bottom-left-radius:0px; 393 | border-bottom-right-radius:0px; 394 | box-shadow:0 0 20px #3c3c3c; 395 | //z-index:9908; 396 | }*/ 397 | .layer{ 398 | width:100%; 399 | height:100%; 400 | background-color:rgba(140,140,140,0.5); 401 | //opacity:0.5; 402 | overflow:scroll; 403 | position:fixed; 404 | top:0; 405 | left:0; 406 | visibility:hidden; 407 | //background-color:rgba(140,0,0,0.5); 408 | //z-index:999; 409 | } 410 | .modal-content{ 411 | width:1000px; 412 | margin: 30px auto; 413 | } 414 | .bottom_img{ 415 | width:1000px; 416 | height:60px; 417 | margin:0px auto; 418 | margin-top:-20px; 419 | margin-bottom:40px; 420 | padding:10px; 421 | background:white; 422 | border:1px solid #9c9c9c; 423 | border-radius:10px; 424 | border-top-left-radius:0px; 425 | border-top-right-radius:0px; 426 | box-shadow:0 20px 20px #3c3c3c; 427 | } 428 | .btn-file { 429 | position: relative; 430 | overflow: hidden; 431 | } 432 | .btn-file input[type=file] { 433 | position: absolute; 434 | top: 0; 435 | right: 0; 436 | min-width: 100%; 437 | min-height: 100%; 438 | font-size: 100px; 439 | text-align: right; 440 | filter: alpha(opacity=0); 441 | opacity: 0; 442 | outline: none; 443 | background: white; 444 | cursor: inherit; 445 | display: block; 446 | } 447 | -------------------------------------------------------------------------------- /tdesignAPI/src/Preload.js: -------------------------------------------------------------------------------- 1 | _html2canvas.Preload = function( options ) { 2 | 3 | var images = { 4 | numLoaded: 0, // also failed are counted here 5 | numFailed: 0, 6 | numTotal: 0, 7 | cleanupDone: false 8 | }, 9 | pageOrigin, 10 | Util = _html2canvas.Util, 11 | methods, 12 | i, 13 | count = 0, 14 | element = options.elements[0] || document.body, 15 | doc = element.ownerDocument, 16 | domImages = element.getElementsByTagName('img'), // Fetch images of the present element only 17 | imgLen = domImages.length, 18 | link = doc.createElement("a"), 19 | supportCORS = (function( img ){ 20 | return (img.crossOrigin !== undefined); 21 | })(new Image()), 22 | timeoutTimer; 23 | 24 | link.href = window.location.href; 25 | pageOrigin = link.protocol + link.host; 26 | 27 | function isSameOrigin(url){ 28 | link.href = url; 29 | link.href = link.href; // YES, BELIEVE IT OR NOT, that is required for IE9 - http://jsfiddle.net/niklasvh/2e48b/ 30 | var origin = link.protocol + link.host; 31 | return (origin === pageOrigin); 32 | } 33 | 34 | function start(){ 35 | Util.log("html2canvas: start: images: " + images.numLoaded + " / " + images.numTotal + " (failed: " + images.numFailed + ")"); 36 | if (!images.firstRun && images.numLoaded >= images.numTotal){ 37 | Util.log("Finished loading images: # " + images.numTotal + " (failed: " + images.numFailed + ")"); 38 | 39 | if (typeof options.complete === "function"){ 40 | options.complete(images); 41 | } 42 | 43 | } 44 | } 45 | 46 | // TODO modify proxy to serve images with CORS enabled, where available 47 | function proxyGetImage(url, img, imageObj){ 48 | var callback_name, 49 | scriptUrl = options.proxy, 50 | script; 51 | 52 | link.href = url; 53 | url = link.href; // work around for pages with base href="" set - WARNING: this may change the url 54 | 55 | callback_name = 'html2canvas_' + (count++); 56 | imageObj.callbackname = callback_name; 57 | 58 | if (scriptUrl.indexOf("?") > -1) { 59 | scriptUrl += "&"; 60 | } else { 61 | scriptUrl += "?"; 62 | } 63 | scriptUrl += 'url=' + encodeURIComponent(url) + '&callback=' + callback_name; 64 | script = doc.createElement("script"); 65 | 66 | window[callback_name] = function(a){ 67 | if (a.substring(0,6) === "error:"){ 68 | imageObj.succeeded = false; 69 | images.numLoaded++; 70 | images.numFailed++; 71 | start(); 72 | } else { 73 | setImageLoadHandlers(img, imageObj); 74 | img.src = a; 75 | } 76 | window[callback_name] = undefined; // to work with IE<9 // NOTE: that the undefined callback property-name still exists on the window object (for IE<9) 77 | try { 78 | delete window[callback_name]; // for all browser that support this 79 | } catch(ex) {} 80 | script.parentNode.removeChild(script); 81 | script = null; 82 | delete imageObj.script; 83 | delete imageObj.callbackname; 84 | }; 85 | 86 | script.setAttribute("type", "text/javascript"); 87 | script.setAttribute("src", scriptUrl); 88 | imageObj.script = script; 89 | window.document.body.appendChild(script); 90 | 91 | } 92 | 93 | function loadPseudoElement(element, type) { 94 | var style = window.getComputedStyle(element, type), 95 | content = style.content; 96 | if (content.substr(0, 3) === 'url') { 97 | methods.loadImage(_html2canvas.Util.parseBackgroundImage(content)[0].args[0]); 98 | } 99 | loadBackgroundImages(style.backgroundImage, element); 100 | } 101 | 102 | function loadPseudoElementImages(element) { 103 | loadPseudoElement(element, ":before"); 104 | loadPseudoElement(element, ":after"); 105 | } 106 | 107 | function loadGradientImage(backgroundImage, bounds) { 108 | var img = _html2canvas.Generate.Gradient(backgroundImage, bounds); 109 | 110 | if (img !== undefined){ 111 | images[backgroundImage] = { 112 | img: img, 113 | succeeded: true 114 | }; 115 | images.numTotal++; 116 | images.numLoaded++; 117 | start(); 118 | } 119 | } 120 | 121 | function invalidBackgrounds(background_image) { 122 | return (background_image && background_image.method && background_image.args && background_image.args.length > 0 ); 123 | } 124 | 125 | function loadBackgroundImages(background_image, el) { 126 | var bounds; 127 | 128 | _html2canvas.Util.parseBackgroundImage(background_image).filter(invalidBackgrounds).forEach(function(background_image) { 129 | if (background_image.method === 'url') { 130 | methods.loadImage(background_image.args[0]); 131 | } else if(background_image.method.match(/\-?gradient$/)) { 132 | if(bounds === undefined) { 133 | bounds = _html2canvas.Util.Bounds(el); 134 | } 135 | loadGradientImage(background_image.value, bounds); 136 | } 137 | }); 138 | } 139 | 140 | function getImages (el) { 141 | var elNodeType = false; 142 | 143 | // Firefox fails with permission denied on pages with iframes 144 | try { 145 | Util.Children(el).forEach(getImages); 146 | } 147 | catch( e ) {} 148 | 149 | try { 150 | elNodeType = el.nodeType; 151 | } catch (ex) { 152 | elNodeType = false; 153 | Util.log("html2canvas: failed to access some element's nodeType - Exception: " + ex.message); 154 | } 155 | 156 | if (elNodeType === 1 || elNodeType === undefined) { 157 | loadPseudoElementImages(el); 158 | try { 159 | loadBackgroundImages(Util.getCSS(el, 'backgroundImage'), el); 160 | } catch(e) { 161 | Util.log("html2canvas: failed to get background-image - Exception: " + e.message); 162 | } 163 | loadBackgroundImages(el); 164 | } 165 | } 166 | 167 | function setImageLoadHandlers(img, imageObj) { 168 | img.onload = function() { 169 | if ( imageObj.timer !== undefined ) { 170 | // CORS succeeded 171 | window.clearTimeout( imageObj.timer ); 172 | } 173 | 174 | images.numLoaded++; 175 | imageObj.succeeded = true; 176 | img.onerror = img.onload = null; 177 | start(); 178 | }; 179 | img.onerror = function() { 180 | if (img.crossOrigin === "anonymous") { 181 | // CORS failed 182 | window.clearTimeout( imageObj.timer ); 183 | 184 | // let's try with proxy instead 185 | if ( options.proxy ) { 186 | var src = img.src; 187 | img = new Image(); 188 | imageObj.img = img; 189 | img.src = src; 190 | 191 | proxyGetImage( img.src, img, imageObj ); 192 | return; 193 | } 194 | } 195 | 196 | images.numLoaded++; 197 | images.numFailed++; 198 | imageObj.succeeded = false; 199 | img.onerror = img.onload = null; 200 | start(); 201 | }; 202 | } 203 | 204 | methods = { 205 | loadImage: function( src ) { 206 | var img, imageObj; 207 | if ( src && images[src] === undefined ) { 208 | img = new Image(); 209 | if ( src.match(/data:image\/.*;base64,/i) ) { 210 | img.src = src.replace(/url\(['"]{0,}|['"]{0,}\)$/ig, ''); 211 | imageObj = images[src] = { 212 | img: img 213 | }; 214 | images.numTotal++; 215 | setImageLoadHandlers(img, imageObj); 216 | } else if ( isSameOrigin( src ) || options.allowTaint === true ) { 217 | imageObj = images[src] = { 218 | img: img 219 | }; 220 | images.numTotal++; 221 | setImageLoadHandlers(img, imageObj); 222 | img.src = src; 223 | } else if ( supportCORS && !options.allowTaint && options.useCORS ) { 224 | // attempt to load with CORS 225 | 226 | img.crossOrigin = "anonymous"; 227 | imageObj = images[src] = { 228 | img: img 229 | }; 230 | images.numTotal++; 231 | setImageLoadHandlers(img, imageObj); 232 | img.src = src; 233 | } else if ( options.proxy ) { 234 | imageObj = images[src] = { 235 | img: img 236 | }; 237 | images.numTotal++; 238 | proxyGetImage( src, img, imageObj ); 239 | } 240 | } 241 | 242 | }, 243 | cleanupDOM: function(cause) { 244 | var img, src; 245 | if (!images.cleanupDone) { 246 | if (cause && typeof cause === "string") { 247 | Util.log("html2canvas: Cleanup because: " + cause); 248 | } else { 249 | Util.log("html2canvas: Cleanup after timeout: " + options.timeout + " ms."); 250 | } 251 | 252 | for (src in images) { 253 | if (images.hasOwnProperty(src)) { 254 | img = images[src]; 255 | if (typeof img === "object" && img.callbackname && img.succeeded === undefined) { 256 | // cancel proxy image request 257 | window[img.callbackname] = undefined; // to work with IE<9 // NOTE: that the undefined callback property-name still exists on the window object (for IE<9) 258 | try { 259 | delete window[img.callbackname]; // for all browser that support this 260 | } catch(ex) {} 261 | if (img.script && img.script.parentNode) { 262 | img.script.setAttribute("src", "about:blank"); // try to cancel running request 263 | img.script.parentNode.removeChild(img.script); 264 | } 265 | images.numLoaded++; 266 | images.numFailed++; 267 | Util.log("html2canvas: Cleaned up failed img: '" + src + "' Steps: " + images.numLoaded + " / " + images.numTotal); 268 | } 269 | } 270 | } 271 | 272 | // cancel any pending requests 273 | if(window.stop !== undefined) { 274 | window.stop(); 275 | } else if(document.execCommand !== undefined) { 276 | document.execCommand("Stop", false); 277 | } 278 | if (document.close !== undefined) { 279 | document.close(); 280 | } 281 | images.cleanupDone = true; 282 | if (!(cause && typeof cause === "string")) { 283 | start(); 284 | } 285 | } 286 | }, 287 | 288 | renderingDone: function() { 289 | if (timeoutTimer) { 290 | window.clearTimeout(timeoutTimer); 291 | } 292 | } 293 | }; 294 | 295 | if (options.timeout > 0) { 296 | timeoutTimer = window.setTimeout(methods.cleanupDOM, options.timeout); 297 | } 298 | 299 | Util.log('html2canvas: Preload starts: finding background-images'); 300 | images.firstRun = true; 301 | 302 | getImages(element); 303 | 304 | Util.log('html2canvas: Preload: Finding images'); 305 | // load images 306 | for (i = 0; i < imgLen; i+=1){ 307 | methods.loadImage( domImages[i].getAttribute( "src" ) ); 308 | } 309 | 310 | images.firstRun = false; 311 | Util.log('html2canvas: Preload: Done.'); 312 | if (images.numTotal === images.numLoaded) { 313 | start(); 314 | } 315 | 316 | return methods; 317 | }; 318 | -------------------------------------------------------------------------------- /tdesignAPI/js/mainapp.js: -------------------------------------------------------------------------------- 1 | var $type="tee",$color="black",$y_pos="front",$nos_icons=0,$nos_text=0,$custom_img=0; 2 | $(document).ready(function(){ 3 | 4 | //ONLOAD 5 | $("#preview_front").css('background-image', 'url(tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_front.png) ') ; 6 | $("#preview_back").css('background-image', 'url(tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_back.png) ') ; 7 | //$("#preview_front, #preview_back , #preview_left, #preview_right").css('background-color', 'blue') ; 8 | $("#preview_front,.T_type").removeClass('dis_none'); 9 | $("#preview_back,.color_pick,.default_samples,.custom_icon,.custom_font").addClass('dis_none') ; 10 | //$('.modal').css('dispaly','none'); 11 | 12 | //ONLOAD OVER 13 | 14 | /*==========================SWITCH MENU===========================*/ 15 | $(".sel_type").click(function(){ 16 | $(".T_type").removeClass('dis_none'); 17 | $(".color_pick,.default_samples,.custom_icon,.custom_font").addClass('dis_none') ; 18 | }); 19 | $(".sel_color").click(function(){ 20 | $(".color_pick").removeClass('dis_none'); 21 | $(".T_type,.default_samples,.custom_icon,.custom_font").addClass('dis_none') ; 22 | }); 23 | $(".sel_art").click(function(){ 24 | $(".default_samples").removeClass('dis_none'); 25 | $(".T_type,.color_pick,.custom_icon,.custom_font").addClass('dis_none') ; 26 | }); 27 | $(".sel_custom_icon").click(function(){ 28 | $(".custom_icon").removeClass('dis_none'); 29 | $(".T_type,.color_pick,.default_samples,.custom_font").addClass('dis_none') ; 30 | }); 31 | $(".sel_text").click(function(){ 32 | $(".custom_font").removeClass('dis_none'); 33 | $(".T_type,.color_pick,.default_samples,.custom_icon").addClass('dis_none') ; 34 | }); 35 | 36 | 37 | /*=========================SWITCH MENU OVER=====================*/ 38 | /*==========================select type=====================*/ 39 | $("#radio1").click(function(){ //tee 40 | $type="tee"; 41 | change_it(); 42 | 43 | }); 44 | $("#radio2").click(function(){ //polo 45 | $type="polo"; 46 | change_it(); 47 | 48 | }); 49 | $("#radio3").click(function(){ //hoodie 50 | $type="hoodie"; 51 | change_it(); 52 | }); 53 | /*==========================select type over=====================*/ 54 | /*==========================select back or front=====================*/ 55 | $("#o_front").click(function(){ 56 | $y_pos="front"; 57 | $("#preview_front").css('background-image', 'url(tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_'+$y_pos+'.png) ') ; 58 | $("#o_front").attr('src','tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_front.png'); 59 | $("#o_back").attr('src','tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_back.png'); 60 | $("#preview_front").removeClass('dis_none') ; 61 | $("#preview_back").addClass('dis_none') ; 62 | 63 | }); 64 | $("#o_back").click(function(){ 65 | $y_pos="back"; 66 | $("#preview_back").css('background-image', 'url(tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_'+$y_pos+'.png) ') ; 67 | $("#o_front").attr('src','tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_front.png'); 68 | $("#o_back").attr('src','tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_back.png'); 69 | $("#preview_back").removeClass('dis_none') ; 70 | $("#preview_front").addClass('dis_none') ; 71 | 72 | }); 73 | /*==========================select back or front OVER=====================*/ 74 | /*==========================select COLOR=====================*/ 75 | $('#red').click(function(){ 76 | $color="red"; 77 | change_it(); 78 | }); 79 | $('#black').click(function(){ 80 | $color="black"; 81 | change_it(); 82 | }); 83 | $('#white').click(function(){ 84 | $color="white"; 85 | change_it(); 86 | }); 87 | $('#green').click(function(){ 88 | $color="green"; 89 | change_it(); 90 | }); 91 | $('#navy').click(function(){ 92 | $color="navy"; 93 | change_it(); 94 | }); 95 | function change_it(){ 96 | $("#preview_back").css('background-image', 'url(tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_back.png) ') ; 97 | $("#preview_front").css('background-image', 'url(tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_front.png) ') ; 98 | $("#o_front").attr('src','tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_front.png'); 99 | $("#o_back").attr('src','tdesignAPI/images/product/'+$type+'/'+$color+'/'+$color+'_back.png'); 100 | 101 | } 102 | /*==========================select COLOR OVER=====================*/ 103 | /*=====================SAMPLE ICONS========================*/ 104 | $(".sample_icons").click(function(){ 105 | var $srcimg=$(this).children("img").attr('src'); 106 | image_icon($srcimg); 107 | 108 | }); 109 | 110 | $(".folder_toggle").click(function(){ 111 | $i=$(this).attr('value'); 112 | $folder=$(this).attr('data-folder'); 113 | $.ajax({ 114 | url: 'tdesignAPI/control/newcontent.php?folder='+$folder, 115 | success: function() 116 | { 117 | $("#toggle_show"+$i ).empty().load("tdesignAPI/control/newcontent.php?folder="+$folder); 118 | } 119 | }); 120 | }); 121 | /*=====================SAMPLE ICONS over========================*/ 122 | 123 | /* 124 | * Font resiZable 125 | * 126 | * 127 | * 128 | * 129 | var initDiagonal; 130 | var initFontSize; 131 | 132 | $(function() { 133 | $("#resizable").resizable({ 134 | alsoResize: '#content', 135 | create: function(event, ui) { 136 | initDiagonal = getContentDiagonal(); 137 | initFontSize = parseInt($("#content").css("font-size")); 138 | }, 139 | resize: function(e, ui) { 140 | var newDiagonal = getContentDiagonal(); 141 | var ratio = newDiagonal / initDiagonal; 142 | 143 | $("#content").css("font-size", initFontSize + ratio * 3); 144 | } 145 | }); 146 | }); 147 | 148 | function getContentDiagonal() { 149 | var contentWidth = $("#content").width(); 150 | var contentHeight = $("#content").height(); 151 | return contentWidth * contentWidth + contentHeight * contentHeight; 152 | } 153 | /* 154 | * 155 | * 156 | * 157 | */ 158 | 159 | $('#apply_text').click(function(){ 160 | 161 | var text_val = jQuery("textarea#custom_text").val(); 162 | if(!text_val) 163 | return false; 164 | 165 | $("."+$y_pos+"_print").append("
"); 166 | $( "#text"+($nos_text)+"" ).draggable({ containment: "parent" }); 167 | $( "#text"+($nos_text)+"" ).resizable({ 168 | maxHeight: 480, 169 | maxWidth: 450, 170 | minHeight: 60, 171 | minWidth: 60 172 | }); 173 | 174 | var $font_ =$('#custom_text').css("font-family"); 175 | var $font_size =$('#custom_text').css("font-size"); 176 | var $font_weight =$('#custom_text').css("font-weight"); 177 | var $font_style =$('#custom_text').css("font-style"); 178 | var $font_color =$('#custom_text').css("color"); 179 | //alert($font_u); 180 | 181 | 182 | $("#text"+($nos_text)+" textarea" ).css("font-family", $font_); 183 | $("#text"+($nos_text)+" textarea" ).css("font-size", $font_size); 184 | $("#text"+($nos_text)+" textarea" ).css("font-weight", $font_weight); 185 | $("#text"+($nos_text)+" textarea" ).css("font-style", $font_style); 186 | $("#text"+($nos_text)+" textarea" ).css("color", $font_color); 187 | $("#text"+($nos_text)).css({'top':'100px','left':'150px'}); 188 | //document.getElementById("text"+($nos_text)+" textarea").style.textDecoration=(""+$font_u+""); 189 | ++$nos_text; 190 | }); 191 | $('.preview_images').click(function(){ 192 | capture(); 193 | //$('.modal').addClass('in'); 194 | $('.layer').css('visibility','visible'); 195 | //$('.layer').css('visibility','visible'); 196 | //$('body').css('position','fixed'); 197 | //$('.modal').css({'display':'block','height':'auto'}); 198 | //$('.design_api').css('position', 'fixed'); 199 | //$('.modal').css('overflow', 'scroll'); 200 | }); 201 | 202 | 203 | $('.close_img').click(function(){ 204 | 205 | 206 | $('.layer').css('visibility','hidden'); 207 | //$('.layer').css('visibility','hidden'); 208 | //$('body').css('position','relative'); 209 | 210 | }); 211 | 212 | function capture() { 213 | 214 | $("#preview_back").removeClass('dis_none') ; 215 | $("#preview_front").removeClass('dis_none') ; 216 | $("#image_reply").empty(); 217 | $y_pos="front"; 218 | html2canvas($('#preview_front'), { 219 | onrendered: function(canvas) { 220 | document.getElementById("image_reply").appendChild(canvas); 221 | //Set hidden field's value to image data (base-64 string) 222 | $('#img_front').val(canvas.toDataURL("image/png")); 223 | } 224 | }); 225 | //$('#preview_front').hide(); 226 | //$('#preview_back').show(); 227 | html2canvas($('#preview_back'), { 228 | onrendered: function(canvas) { 229 | //$('#img_back').val(canvas.toDataURL("image/png")); 230 | document.getElementById("image_reply").appendChild(canvas); 231 | $('#img_back').val(canvas.toDataURL("image/png")); 232 | $("#preview_back").addClass('dis_none') ; 233 | } 234 | }); 235 | } 236 | 237 | 238 | }); 239 | 240 | function image_icon($srcimg){ 241 | $("."+$y_pos+"_print").append("
"); 242 | $( "#icon"+($nos_icons)+"" ).draggable({ containment: "parent" }); 243 | $( "#icon"+($nos_icons)+"" ).resizable({ 244 | maxHeight: 480, 245 | maxWidth: 450, 246 | minHeight: 60, 247 | minWidth: 60 248 | }); 249 | $( "#icon"+($nos_icons)+"" ).css({'top':'100px','left':'150px'}); 250 | ++$nos_icons; 251 | } 252 | 253 | function delete_icons(e){ 254 | 255 | $(e).parent('.new_icon').remove(); 256 | 257 | --$nos_icons; 258 | } 259 | function show_delete_btn(e){ 260 | 261 | $(e).children('.property_icon').show(); 262 | } 263 | function hide_delete_btn(e){ 264 | 265 | $(e).children('.property_icon').hide(); 266 | } 267 | 268 | /*=============================================*/ 269 | function delete_text(f){ 270 | $(f).parent('.new_text').remove(); 271 | --$nos_icons; 272 | } 273 | 274 | function readURL(input) { 275 | if (input.files && input.files[0]) { 276 | var reader = new FileReader(); 277 | reader.onload = function (e) { 278 | 279 | $("."+$y_pos+"_print").append("
"); 280 | $( "#c_icon"+($custom_img)+"" ).draggable({ containment: "parent" }); 281 | $( "#c_icon"+($custom_img)+"" ).resizable({ 282 | maxHeight: 480, 283 | maxWidth: 450, 284 | minHeight: 60, 285 | minWidth: 60 286 | }); 287 | 288 | 289 | $("#c_img"+($custom_img)+"").attr('src', e.target.result); 290 | ++$custom_img; 291 | }; 292 | reader.readAsDataURL(input.files[0]); 293 | } 294 | } -------------------------------------------------------------------------------- /tdesignAPI/src/Core.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _html2canvas = {}, 4 | previousElement, 5 | computedCSS, 6 | html2canvas; 7 | 8 | _html2canvas.Util = {}; 9 | 10 | _html2canvas.Util.log = function(a) { 11 | if (_html2canvas.logging && window.console && window.console.log) { 12 | window.console.log(a); 13 | } 14 | }; 15 | 16 | _html2canvas.Util.trimText = (function(isNative){ 17 | return function(input) { 18 | return isNative ? isNative.apply(input) : ((input || '') + '').replace( /^\s+|\s+$/g , '' ); 19 | }; 20 | })(String.prototype.trim); 21 | 22 | _html2canvas.Util.asFloat = function(v) { 23 | return parseFloat(v); 24 | }; 25 | 26 | (function() { 27 | // TODO: support all possible length values 28 | var TEXT_SHADOW_PROPERTY = /((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g; 29 | var TEXT_SHADOW_VALUES = /(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g; 30 | _html2canvas.Util.parseTextShadows = function (value) { 31 | if (!value || value === 'none') { 32 | return []; 33 | } 34 | 35 | // find multiple shadow declarations 36 | var shadows = value.match(TEXT_SHADOW_PROPERTY), 37 | results = []; 38 | for (var i = 0; shadows && (i < shadows.length); i++) { 39 | var s = shadows[i].match(TEXT_SHADOW_VALUES); 40 | results.push({ 41 | color: s[0], 42 | offsetX: s[1] ? s[1].replace('px', '') : 0, 43 | offsetY: s[2] ? s[2].replace('px', '') : 0, 44 | blur: s[3] ? s[3].replace('px', '') : 0 45 | }); 46 | } 47 | return results; 48 | }; 49 | })(); 50 | 51 | 52 | _html2canvas.Util.parseBackgroundImage = function (value) { 53 | var whitespace = ' \r\n\t', 54 | method, definition, prefix, prefix_i, block, results = [], 55 | c, mode = 0, numParen = 0, quote, args; 56 | 57 | var appendResult = function(){ 58 | if(method) { 59 | if(definition.substr( 0, 1 ) === '"') { 60 | definition = definition.substr( 1, definition.length - 2 ); 61 | } 62 | if(definition) { 63 | args.push(definition); 64 | } 65 | if(method.substr( 0, 1 ) === '-' && 66 | (prefix_i = method.indexOf( '-', 1 ) + 1) > 0) { 67 | prefix = method.substr( 0, prefix_i); 68 | method = method.substr( prefix_i ); 69 | } 70 | results.push({ 71 | prefix: prefix, 72 | method: method.toLowerCase(), 73 | value: block, 74 | args: args 75 | }); 76 | } 77 | args = []; //for some odd reason, setting .length = 0 didn't work in safari 78 | method = 79 | prefix = 80 | definition = 81 | block = ''; 82 | }; 83 | 84 | appendResult(); 85 | for(var i = 0, ii = value.length; i -1){ 88 | continue; 89 | } 90 | switch(c) { 91 | case '"': 92 | if(!quote) { 93 | quote = c; 94 | } 95 | else if(quote === c) { 96 | quote = null; 97 | } 98 | break; 99 | 100 | case '(': 101 | if(quote) { break; } 102 | else if(mode === 0) { 103 | mode = 1; 104 | block += c; 105 | continue; 106 | } else { 107 | numParen++; 108 | } 109 | break; 110 | 111 | case ')': 112 | if(quote) { break; } 113 | else if(mode === 1) { 114 | if(numParen === 0) { 115 | mode = 0; 116 | block += c; 117 | appendResult(); 118 | continue; 119 | } else { 120 | numParen--; 121 | } 122 | } 123 | break; 124 | 125 | case ',': 126 | if(quote) { break; } 127 | else if(mode === 0) { 128 | appendResult(); 129 | continue; 130 | } 131 | else if (mode === 1) { 132 | if(numParen === 0 && !method.match(/^url$/i)) { 133 | args.push(definition); 134 | definition = ''; 135 | block += c; 136 | continue; 137 | } 138 | } 139 | break; 140 | } 141 | 142 | block += c; 143 | if(mode === 0) { method += c; } 144 | else { definition += c; } 145 | } 146 | appendResult(); 147 | 148 | return results; 149 | }; 150 | 151 | _html2canvas.Util.Bounds = function (element) { 152 | var clientRect, bounds = {}; 153 | 154 | if (element.getBoundingClientRect){ 155 | clientRect = element.getBoundingClientRect(); 156 | 157 | // TODO add scroll position to bounds, so no scrolling of window necessary 158 | bounds.top = clientRect.top; 159 | bounds.bottom = clientRect.bottom || (clientRect.top + clientRect.height); 160 | bounds.left = clientRect.left; 161 | 162 | bounds.width = element.offsetWidth; 163 | bounds.height = element.offsetHeight; 164 | } 165 | 166 | return bounds; 167 | }; 168 | 169 | // TODO ideally, we'd want everything to go through this function instead of Util.Bounds, 170 | // but would require further work to calculate the correct positions for elements with offsetParents 171 | _html2canvas.Util.OffsetBounds = function (element) { 172 | var parent = element.offsetParent ? _html2canvas.Util.OffsetBounds(element.offsetParent) : {top: 0, left: 0}; 173 | 174 | return { 175 | top: element.offsetTop + parent.top, 176 | bottom: element.offsetTop + element.offsetHeight + parent.top, 177 | left: element.offsetLeft + parent.left, 178 | width: element.offsetWidth, 179 | height: element.offsetHeight 180 | }; 181 | }; 182 | 183 | function toPX(element, attribute, value ) { 184 | var rsLeft = element.runtimeStyle && element.runtimeStyle[attribute], 185 | left, 186 | style = element.style; 187 | 188 | // Check if we are not dealing with pixels, (Opera has issues with this) 189 | // Ported from jQuery css.js 190 | // From the awesome hack by Dean Edwards 191 | // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 192 | 193 | // If we're not dealing with a regular pixel number 194 | // but a number that has a weird ending, we need to convert it to pixels 195 | 196 | if ( !/^-?[0-9]+\.?[0-9]*(?:px)?$/i.test( value ) && /^-?\d/.test(value) ) { 197 | // Remember the original values 198 | left = style.left; 199 | 200 | // Put in the new values to get a computed value out 201 | if (rsLeft) { 202 | element.runtimeStyle.left = element.currentStyle.left; 203 | } 204 | style.left = attribute === "fontSize" ? "1em" : (value || 0); 205 | value = style.pixelLeft + "px"; 206 | 207 | // Revert the changed values 208 | style.left = left; 209 | if (rsLeft) { 210 | element.runtimeStyle.left = rsLeft; 211 | } 212 | } 213 | 214 | if (!/^(thin|medium|thick)$/i.test(value)) { 215 | return Math.round(parseFloat(value)) + "px"; 216 | } 217 | 218 | return value; 219 | } 220 | 221 | function asInt(val) { 222 | return parseInt(val, 10); 223 | } 224 | 225 | function parseBackgroundSizePosition(value, element, attribute, index) { 226 | value = (value || '').split(','); 227 | value = value[index || 0] || value[0] || 'auto'; 228 | value = _html2canvas.Util.trimText(value).split(' '); 229 | 230 | if(attribute === 'backgroundSize' && (!value[0] || value[0].match(/cover|contain|auto/))) { 231 | //these values will be handled in the parent function 232 | } else { 233 | value[0] = (value[0].indexOf( "%" ) === -1) ? toPX(element, attribute + "X", value[0]) : value[0]; 234 | if(value[1] === undefined) { 235 | if(attribute === 'backgroundSize') { 236 | value[1] = 'auto'; 237 | return value; 238 | } else { 239 | // IE 9 doesn't return double digit always 240 | value[1] = value[0]; 241 | } 242 | } 243 | value[1] = (value[1].indexOf("%") === -1) ? toPX(element, attribute + "Y", value[1]) : value[1]; 244 | } 245 | return value; 246 | } 247 | 248 | _html2canvas.Util.getCSS = function (element, attribute, index) { 249 | if (previousElement !== element) { 250 | computedCSS = document.defaultView.getComputedStyle(element, null); 251 | } 252 | 253 | var value = computedCSS[attribute]; 254 | 255 | if (/^background(Size|Position)$/.test(attribute)) { 256 | return parseBackgroundSizePosition(value, element, attribute, index); 257 | } else if (/border(Top|Bottom)(Left|Right)Radius/.test(attribute)) { 258 | var arr = value.split(" "); 259 | if (arr.length <= 1) { 260 | arr[1] = arr[0]; 261 | } 262 | return arr.map(asInt); 263 | } 264 | 265 | return value; 266 | }; 267 | 268 | _html2canvas.Util.resizeBounds = function( current_width, current_height, target_width, target_height, stretch_mode ){ 269 | var target_ratio = target_width / target_height, 270 | current_ratio = current_width / current_height, 271 | output_width, output_height; 272 | 273 | if(!stretch_mode || stretch_mode === 'auto') { 274 | output_width = target_width; 275 | output_height = target_height; 276 | } else if(target_ratio < current_ratio ^ stretch_mode === 'contain') { 277 | output_height = target_height; 278 | output_width = target_height * current_ratio; 279 | } else { 280 | output_width = target_width; 281 | output_height = target_width / current_ratio; 282 | } 283 | 284 | return { 285 | width: output_width, 286 | height: output_height 287 | }; 288 | }; 289 | 290 | function backgroundBoundsFactory( prop, el, bounds, image, imageIndex, backgroundSize ) { 291 | var bgposition = _html2canvas.Util.getCSS( el, prop, imageIndex ) , 292 | topPos, 293 | left, 294 | percentage, 295 | val; 296 | 297 | if (bgposition.length === 1){ 298 | val = bgposition[0]; 299 | 300 | bgposition = []; 301 | 302 | bgposition[0] = val; 303 | bgposition[1] = val; 304 | } 305 | 306 | if (bgposition[0].toString().indexOf("%") !== -1){ 307 | percentage = (parseFloat(bgposition[0])/100); 308 | left = bounds.width * percentage; 309 | if(prop !== 'backgroundSize') { 310 | left -= (backgroundSize || image).width*percentage; 311 | } 312 | } else { 313 | if(prop === 'backgroundSize') { 314 | if(bgposition[0] === 'auto') { 315 | left = image.width; 316 | } else { 317 | if (/contain|cover/.test(bgposition[0])) { 318 | var resized = _html2canvas.Util.resizeBounds(image.width, image.height, bounds.width, bounds.height, bgposition[0]); 319 | left = resized.width; 320 | topPos = resized.height; 321 | } else { 322 | left = parseInt(bgposition[0], 10); 323 | } 324 | } 325 | } else { 326 | left = parseInt( bgposition[0], 10); 327 | } 328 | } 329 | 330 | 331 | if(bgposition[1] === 'auto') { 332 | topPos = left / image.width * image.height; 333 | } else if (bgposition[1].toString().indexOf("%") !== -1){ 334 | percentage = (parseFloat(bgposition[1])/100); 335 | topPos = bounds.height * percentage; 336 | if(prop !== 'backgroundSize') { 337 | topPos -= (backgroundSize || image).height * percentage; 338 | } 339 | 340 | } else { 341 | topPos = parseInt(bgposition[1],10); 342 | } 343 | 344 | return [left, topPos]; 345 | } 346 | 347 | _html2canvas.Util.BackgroundPosition = function( el, bounds, image, imageIndex, backgroundSize ) { 348 | var result = backgroundBoundsFactory( 'backgroundPosition', el, bounds, image, imageIndex, backgroundSize ); 349 | return { left: result[0], top: result[1] }; 350 | }; 351 | 352 | _html2canvas.Util.BackgroundSize = function( el, bounds, image, imageIndex ) { 353 | var result = backgroundBoundsFactory( 'backgroundSize', el, bounds, image, imageIndex ); 354 | return { width: result[0], height: result[1] }; 355 | }; 356 | 357 | _html2canvas.Util.Extend = function (options, defaults) { 358 | for (var key in options) { 359 | if (options.hasOwnProperty(key)) { 360 | defaults[key] = options[key]; 361 | } 362 | } 363 | return defaults; 364 | }; 365 | 366 | 367 | /* 368 | * Derived from jQuery.contents() 369 | * Copyright 2010, John Resig 370 | * Dual licensed under the MIT or GPL Version 2 licenses. 371 | * http://jquery.org/license 372 | */ 373 | _html2canvas.Util.Children = function( elem ) { 374 | var children; 375 | try { 376 | children = (elem.nodeName && elem.nodeName.toUpperCase() === "IFRAME") ? elem.contentDocument || elem.contentWindow.document : (function(array) { 377 | var ret = []; 378 | if (array !== null) { 379 | (function(first, second ) { 380 | var i = first.length, 381 | j = 0; 382 | 383 | if (typeof second.length === "number") { 384 | for (var l = second.length; j < l; j++) { 385 | first[i++] = second[j]; 386 | } 387 | } else { 388 | while (second[j] !== undefined) { 389 | first[i++] = second[j++]; 390 | } 391 | } 392 | 393 | first.length = i; 394 | 395 | return first; 396 | })(ret, array); 397 | } 398 | return ret; 399 | })(elem.childNodes); 400 | 401 | } catch (ex) { 402 | _html2canvas.Util.log("html2canvas.Util.Children failed with exception: " + ex.message); 403 | children = []; 404 | } 405 | return children; 406 | }; 407 | 408 | _html2canvas.Util.isTransparent = function(backgroundColor) { 409 | return (backgroundColor === "transparent" || backgroundColor === "rgba(0, 0, 0, 0)"); 410 | }; -------------------------------------------------------------------------------- /tdesignAPI/src/Generate.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var Util = _html2canvas.Util, 3 | Generate = {}; 4 | 5 | _html2canvas.Generate = Generate; 6 | 7 | var reGradients = [ 8 | /^(-webkit-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/, 9 | /^(-o-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/, 10 | /^(-webkit-gradient)\((linear|radial),\s((?:\d{1,3}%?)\s(?:\d{1,3}%?),\s(?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)\-]+)\)$/, 11 | /^(-moz-linear-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)]+)\)$/, 12 | /^(-webkit-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/, 13 | /^(-moz-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s?([a-z\-]*)([\w\d\.\s,%\(\)]+)\)$/, 14 | /^(-o-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/ 15 | ]; 16 | 17 | /* 18 | * TODO: Add IE10 vendor prefix (-ms) support 19 | * TODO: Add W3C gradient (linear-gradient) support 20 | * TODO: Add old Webkit -webkit-gradient(radial, ...) support 21 | * TODO: Maybe some RegExp optimizations are possible ;o) 22 | */ 23 | Generate.parseGradient = function(css, bounds) { 24 | var gradient, i, len = reGradients.length, m1, stop, m2, m2Len, step, m3, tl,tr,br,bl; 25 | 26 | for(i = 0; i < len; i+=1){ 27 | m1 = css.match(reGradients[i]); 28 | if(m1) { 29 | break; 30 | } 31 | } 32 | 33 | if(m1) { 34 | switch(m1[1]) { 35 | case '-webkit-linear-gradient': 36 | case '-o-linear-gradient': 37 | 38 | gradient = { 39 | type: 'linear', 40 | x0: null, 41 | y0: null, 42 | x1: null, 43 | y1: null, 44 | colorStops: [] 45 | }; 46 | 47 | // get coordinates 48 | m2 = m1[2].match(/\w+/g); 49 | if(m2){ 50 | m2Len = m2.length; 51 | for(i = 0; i < m2Len; i+=1){ 52 | switch(m2[i]) { 53 | case 'top': 54 | gradient.y0 = 0; 55 | gradient.y1 = bounds.height; 56 | break; 57 | 58 | case 'right': 59 | gradient.x0 = bounds.width; 60 | gradient.x1 = 0; 61 | break; 62 | 63 | case 'bottom': 64 | gradient.y0 = bounds.height; 65 | gradient.y1 = 0; 66 | break; 67 | 68 | case 'left': 69 | gradient.x0 = 0; 70 | gradient.x1 = bounds.width; 71 | break; 72 | } 73 | } 74 | } 75 | if(gradient.x0 === null && gradient.x1 === null){ // center 76 | gradient.x0 = gradient.x1 = bounds.width / 2; 77 | } 78 | if(gradient.y0 === null && gradient.y1 === null){ // center 79 | gradient.y0 = gradient.y1 = bounds.height / 2; 80 | } 81 | 82 | // get colors and stops 83 | m2 = m1[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g); 84 | if(m2){ 85 | m2Len = m2.length; 86 | step = 1 / Math.max(m2Len - 1, 1); 87 | for(i = 0; i < m2Len; i+=1){ 88 | m3 = m2[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/); 89 | if(m3[2]){ 90 | stop = parseFloat(m3[2]); 91 | if(m3[3] === '%'){ 92 | stop /= 100; 93 | } else { // px - stupid opera 94 | stop /= bounds.width; 95 | } 96 | } else { 97 | stop = i * step; 98 | } 99 | gradient.colorStops.push({ 100 | color: m3[1], 101 | stop: stop 102 | }); 103 | } 104 | } 105 | break; 106 | 107 | case '-webkit-gradient': 108 | 109 | gradient = { 110 | type: m1[2] === 'radial' ? 'circle' : m1[2], // TODO: Add radial gradient support for older mozilla definitions 111 | x0: 0, 112 | y0: 0, 113 | x1: 0, 114 | y1: 0, 115 | colorStops: [] 116 | }; 117 | 118 | // get coordinates 119 | m2 = m1[3].match(/(\d{1,3})%?\s(\d{1,3})%?,\s(\d{1,3})%?\s(\d{1,3})%?/); 120 | if(m2){ 121 | gradient.x0 = (m2[1] * bounds.width) / 100; 122 | gradient.y0 = (m2[2] * bounds.height) / 100; 123 | gradient.x1 = (m2[3] * bounds.width) / 100; 124 | gradient.y1 = (m2[4] * bounds.height) / 100; 125 | } 126 | 127 | // get colors and stops 128 | m2 = m1[4].match(/((?:from|to|color-stop)\((?:[0-9\.]+,\s)?(?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)\))+/g); 129 | if(m2){ 130 | m2Len = m2.length; 131 | for(i = 0; i < m2Len; i+=1){ 132 | m3 = m2[i].match(/(from|to|color-stop)\(([0-9\.]+)?(?:,\s)?((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\)/); 133 | stop = parseFloat(m3[2]); 134 | if(m3[1] === 'from') { 135 | stop = 0.0; 136 | } 137 | if(m3[1] === 'to') { 138 | stop = 1.0; 139 | } 140 | gradient.colorStops.push({ 141 | color: m3[3], 142 | stop: stop 143 | }); 144 | } 145 | } 146 | break; 147 | 148 | case '-moz-linear-gradient': 149 | 150 | gradient = { 151 | type: 'linear', 152 | x0: 0, 153 | y0: 0, 154 | x1: 0, 155 | y1: 0, 156 | colorStops: [] 157 | }; 158 | 159 | // get coordinates 160 | m2 = m1[2].match(/(\d{1,3})%?\s(\d{1,3})%?/); 161 | 162 | // m2[1] == 0% -> left 163 | // m2[1] == 50% -> center 164 | // m2[1] == 100% -> right 165 | 166 | // m2[2] == 0% -> top 167 | // m2[2] == 50% -> center 168 | // m2[2] == 100% -> bottom 169 | 170 | if(m2){ 171 | gradient.x0 = (m2[1] * bounds.width) / 100; 172 | gradient.y0 = (m2[2] * bounds.height) / 100; 173 | gradient.x1 = bounds.width - gradient.x0; 174 | gradient.y1 = bounds.height - gradient.y0; 175 | } 176 | 177 | // get colors and stops 178 | m2 = m1[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}%)?)+/g); 179 | if(m2){ 180 | m2Len = m2.length; 181 | step = 1 / Math.max(m2Len - 1, 1); 182 | for(i = 0; i < m2Len; i+=1){ 183 | m3 = m2[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/); 184 | if(m3[2]){ 185 | stop = parseFloat(m3[2]); 186 | if(m3[3]){ // percentage 187 | stop /= 100; 188 | } 189 | } else { 190 | stop = i * step; 191 | } 192 | gradient.colorStops.push({ 193 | color: m3[1], 194 | stop: stop 195 | }); 196 | } 197 | } 198 | break; 199 | 200 | case '-webkit-radial-gradient': 201 | case '-moz-radial-gradient': 202 | case '-o-radial-gradient': 203 | 204 | gradient = { 205 | type: 'circle', 206 | x0: 0, 207 | y0: 0, 208 | x1: bounds.width, 209 | y1: bounds.height, 210 | cx: 0, 211 | cy: 0, 212 | rx: 0, 213 | ry: 0, 214 | colorStops: [] 215 | }; 216 | 217 | // center 218 | m2 = m1[2].match(/(\d{1,3})%?\s(\d{1,3})%?/); 219 | if(m2){ 220 | gradient.cx = (m2[1] * bounds.width) / 100; 221 | gradient.cy = (m2[2] * bounds.height) / 100; 222 | } 223 | 224 | // size 225 | m2 = m1[3].match(/\w+/); 226 | m3 = m1[4].match(/[a-z\-]*/); 227 | if(m2 && m3){ 228 | switch(m3[0]){ 229 | case 'farthest-corner': 230 | case 'cover': // is equivalent to farthest-corner 231 | case '': // mozilla removes "cover" from definition :( 232 | tl = Math.sqrt(Math.pow(gradient.cx, 2) + Math.pow(gradient.cy, 2)); 233 | tr = Math.sqrt(Math.pow(gradient.cx, 2) + Math.pow(gradient.y1 - gradient.cy, 2)); 234 | br = Math.sqrt(Math.pow(gradient.x1 - gradient.cx, 2) + Math.pow(gradient.y1 - gradient.cy, 2)); 235 | bl = Math.sqrt(Math.pow(gradient.x1 - gradient.cx, 2) + Math.pow(gradient.cy, 2)); 236 | gradient.rx = gradient.ry = Math.max(tl, tr, br, bl); 237 | break; 238 | case 'closest-corner': 239 | tl = Math.sqrt(Math.pow(gradient.cx, 2) + Math.pow(gradient.cy, 2)); 240 | tr = Math.sqrt(Math.pow(gradient.cx, 2) + Math.pow(gradient.y1 - gradient.cy, 2)); 241 | br = Math.sqrt(Math.pow(gradient.x1 - gradient.cx, 2) + Math.pow(gradient.y1 - gradient.cy, 2)); 242 | bl = Math.sqrt(Math.pow(gradient.x1 - gradient.cx, 2) + Math.pow(gradient.cy, 2)); 243 | gradient.rx = gradient.ry = Math.min(tl, tr, br, bl); 244 | break; 245 | case 'farthest-side': 246 | if(m2[0] === 'circle'){ 247 | gradient.rx = gradient.ry = Math.max( 248 | gradient.cx, 249 | gradient.cy, 250 | gradient.x1 - gradient.cx, 251 | gradient.y1 - gradient.cy 252 | ); 253 | } else { // ellipse 254 | 255 | gradient.type = m2[0]; 256 | 257 | gradient.rx = Math.max( 258 | gradient.cx, 259 | gradient.x1 - gradient.cx 260 | ); 261 | gradient.ry = Math.max( 262 | gradient.cy, 263 | gradient.y1 - gradient.cy 264 | ); 265 | } 266 | break; 267 | case 'closest-side': 268 | case 'contain': // is equivalent to closest-side 269 | if(m2[0] === 'circle'){ 270 | gradient.rx = gradient.ry = Math.min( 271 | gradient.cx, 272 | gradient.cy, 273 | gradient.x1 - gradient.cx, 274 | gradient.y1 - gradient.cy 275 | ); 276 | } else { // ellipse 277 | 278 | gradient.type = m2[0]; 279 | 280 | gradient.rx = Math.min( 281 | gradient.cx, 282 | gradient.x1 - gradient.cx 283 | ); 284 | gradient.ry = Math.min( 285 | gradient.cy, 286 | gradient.y1 - gradient.cy 287 | ); 288 | } 289 | break; 290 | 291 | // TODO: add support for "30px 40px" sizes (webkit only) 292 | } 293 | } 294 | 295 | // color stops 296 | m2 = m1[5].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g); 297 | if(m2){ 298 | m2Len = m2.length; 299 | step = 1 / Math.max(m2Len - 1, 1); 300 | for(i = 0; i < m2Len; i+=1){ 301 | m3 = m2[i].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/); 302 | if(m3[2]){ 303 | stop = parseFloat(m3[2]); 304 | if(m3[3] === '%'){ 305 | stop /= 100; 306 | } else { // px - stupid opera 307 | stop /= bounds.width; 308 | } 309 | } else { 310 | stop = i * step; 311 | } 312 | gradient.colorStops.push({ 313 | color: m3[1], 314 | stop: stop 315 | }); 316 | } 317 | } 318 | break; 319 | } 320 | } 321 | 322 | return gradient; 323 | }; 324 | 325 | function addScrollStops(grad) { 326 | return function(colorStop) { 327 | try { 328 | grad.addColorStop(colorStop.stop, colorStop.color); 329 | } 330 | catch(e) { 331 | Util.log(['failed to add color stop: ', e, '; tried to add: ', colorStop]); 332 | } 333 | }; 334 | } 335 | 336 | Generate.Gradient = function(src, bounds) { 337 | if(bounds.width === 0 || bounds.height === 0) { 338 | return; 339 | } 340 | 341 | var canvas = document.createElement('canvas'), 342 | ctx = canvas.getContext('2d'), 343 | gradient, grad; 344 | 345 | canvas.width = bounds.width; 346 | canvas.height = bounds.height; 347 | 348 | // TODO: add support for multi defined background gradients 349 | gradient = _html2canvas.Generate.parseGradient(src, bounds); 350 | 351 | if(gradient) { 352 | switch(gradient.type) { 353 | case 'linear': 354 | grad = ctx.createLinearGradient(gradient.x0, gradient.y0, gradient.x1, gradient.y1); 355 | gradient.colorStops.forEach(addScrollStops(grad)); 356 | ctx.fillStyle = grad; 357 | ctx.fillRect(0, 0, bounds.width, bounds.height); 358 | break; 359 | 360 | case 'circle': 361 | grad = ctx.createRadialGradient(gradient.cx, gradient.cy, 0, gradient.cx, gradient.cy, gradient.rx); 362 | gradient.colorStops.forEach(addScrollStops(grad)); 363 | ctx.fillStyle = grad; 364 | ctx.fillRect(0, 0, bounds.width, bounds.height); 365 | break; 366 | 367 | case 'ellipse': 368 | var canvasRadial = document.createElement('canvas'), 369 | ctxRadial = canvasRadial.getContext('2d'), 370 | ri = Math.max(gradient.rx, gradient.ry), 371 | di = ri * 2; 372 | 373 | canvasRadial.width = canvasRadial.height = di; 374 | 375 | grad = ctxRadial.createRadialGradient(gradient.rx, gradient.ry, 0, gradient.rx, gradient.ry, ri); 376 | gradient.colorStops.forEach(addScrollStops(grad)); 377 | 378 | ctxRadial.fillStyle = grad; 379 | ctxRadial.fillRect(0, 0, di, di); 380 | 381 | ctx.fillStyle = gradient.colorStops[gradient.colorStops.length - 1].color; 382 | ctx.fillRect(0, 0, canvas.width, canvas.height); 383 | ctx.drawImage(canvasRadial, gradient.cx - gradient.rx, gradient.cy - gradient.ry, 2 * gradient.rx, 2 * gradient.ry); 384 | break; 385 | } 386 | } 387 | 388 | return canvas; 389 | }; 390 | 391 | Generate.ListAlpha = function(number) { 392 | var tmp = "", 393 | modulus; 394 | 395 | do { 396 | modulus = number % 26; 397 | tmp = String.fromCharCode((modulus) + 64) + tmp; 398 | number = number / 26; 399 | }while((number*26) > 26); 400 | 401 | return tmp; 402 | }; 403 | 404 | Generate.ListRoman = function(number) { 405 | var romanArray = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"], 406 | decimal = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1], 407 | roman = "", 408 | v, 409 | len = romanArray.length; 410 | 411 | if (number <= 0 || number >= 4000) { 412 | return number; 413 | } 414 | 415 | for (v=0; v < len; v+=1) { 416 | while (number >= decimal[v]) { 417 | number -= decimal[v]; 418 | roman += romanArray[v]; 419 | } 420 | } 421 | 422 | return roman; 423 | }; 424 | })(); -------------------------------------------------------------------------------- /tdesignAPI/new_applit.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 57 |
58 |
59 | 60 | 79 | 80 |
81 |
82 |
83 |
84 | 86 |
87 |
88 |
89 | 90 |
91 |
92 |
93 |
94 | 95 |
96 |
97 |
98 | 99 | 100 |
' ; 108 | }elseif(strpos($value,'.') === false){ 109 | //echo '
' .$value. '
' ; 110 | } 111 | //echo "Value: $value
\n"; 112 | } 113 | ?> 114 |
115 |
116 |
117 | Browse 118 | 119 | 120 | 121 |
122 |
123 | 124 |
125 | 126 | 172 | 173 |
174 | 175 | B 176 | I 177 | 178 | 190 |
191 | 192 | 195 | 196 |
197 |
198 | 199 | 200 | 201 |
202 |
203 |
204 | 205 |
206 |
207 |
208 |
209 | 210 |
211 |
212 | 213 |
214 | 215 | 216 | 217 |
218 |
FRONT 219 |
220 |
BACK 221 |
222 |
223 | Preview 224 |
225 |
226 | 227 |
228 |
229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 240 | 241 | 242 | 243 | 246 | 247 | 248 | 249 | 252 | 253 | 254 | 255 | 258 | 259 | 260 | 261 | 264 | 265 | 266 | 267 | 270 | 271 | 272 |
SizeQuantity
S 238 | 239 |
M 244 | 245 |
L 250 | 251 |
XL 256 | 257 |
XXL 262 | 263 |
Total 268 | 269 |
273 | 274 | 277 |
278 |
279 |
280 | 281 | 282 | 286 | 287 |
288 | 372 |
373 | 374 | 399 | 400 | 404 | 405 |
406 | 426 | 427 | -------------------------------------------------------------------------------- /js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.1.0 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); -------------------------------------------------------------------------------- /tdesignAPI/js/html2canvas.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | html2canvas 0.4.1 3 | Copyright (c) 2013 Niklas von Hertzen 4 | 5 | Released under MIT License 6 | */ 7 | (function(t,e,n){"use strict";function r(t,e,n){var r,a=t.runtimeStyle&&t.runtimeStyle[e],o=t.style;return!/^-?[0-9]+\.?[0-9]*(?:px)?$/i.test(n)&&/^-?\d/.test(n)&&(r=o.left,a&&(t.runtimeStyle.left=t.currentStyle.left),o.left="fontSize"===e?"1em":n||0,n=o.pixelLeft+"px",o.left=r,a&&(t.runtimeStyle.left=a)),/^(thin|medium|thick)$/i.test(n)?n:Math.round(parseFloat(n))+"px"}function a(t){return parseInt(t,10)}function o(t,e,a,o){if(t=(t||"").split(","),t=t[o||0]||t[0]||"auto",t=u.Util.trimText(t).split(" "),"backgroundSize"!==a||t[0]&&!t[0].match(/cover|contain|auto/)){if(t[0]=-1===t[0].indexOf("%")?r(e,a+"X",t[0]):t[0],t[1]===n){if("backgroundSize"===a)return t[1]="auto",t;t[1]=t[0]}t[1]=-1===t[1].indexOf("%")?r(e,a+"Y",t[1]):t[1]}else;return t}function i(t,e,n,r,a,o){var i,l,s,c,d=u.Util.getCSS(e,t,a);if(1===d.length&&(c=d[0],d=[],d[0]=c,d[1]=c),-1!==(""+d[0]).indexOf("%"))s=parseFloat(d[0])/100,l=n.width*s,"backgroundSize"!==t&&(l-=(o||r).width*s);else if("backgroundSize"===t)if("auto"===d[0])l=r.width;else if(/contain|cover/.test(d[0])){var h=u.Util.resizeBounds(r.width,r.height,n.width,n.height,d[0]);l=h.width,i=h.height}else l=parseInt(d[0],10);else l=parseInt(d[0],10);return"auto"===d[1]?i=l/r.width*r.height:-1!==(""+d[1]).indexOf("%")?(s=parseFloat(d[1])/100,i=n.height*s,"backgroundSize"!==t&&(i-=(o||r).height*s)):i=parseInt(d[1],10),[l,i]}function l(t,e){var n=[];return{storage:n,width:t,height:e,clip:function(){n.push({type:"function",name:"clip",arguments:arguments})},translate:function(){n.push({type:"function",name:"translate",arguments:arguments})},fill:function(){n.push({type:"function",name:"fill",arguments:arguments})},save:function(){n.push({type:"function",name:"save",arguments:arguments})},restore:function(){n.push({type:"function",name:"restore",arguments:arguments})},fillRect:function(){n.push({type:"function",name:"fillRect",arguments:arguments})},createPattern:function(){n.push({type:"function",name:"createPattern",arguments:arguments})},drawShape:function(){var t=[];return n.push({type:"function",name:"drawShape",arguments:t}),{moveTo:function(){t.push({name:"moveTo",arguments:arguments})},lineTo:function(){t.push({name:"lineTo",arguments:arguments})},arcTo:function(){t.push({name:"arcTo",arguments:arguments})},bezierCurveTo:function(){t.push({name:"bezierCurveTo",arguments:arguments})},quadraticCurveTo:function(){t.push({name:"quadraticCurveTo",arguments:arguments})}}},drawImage:function(){n.push({type:"function",name:"drawImage",arguments:arguments})},fillText:function(){n.push({type:"function",name:"fillText",arguments:arguments})},setVariable:function(t,e){return n.push({type:"variable",name:t,arguments:e}),e}}}function s(t){return{zindex:t,children:[]}}var c,d,u={};u.Util={},u.Util.log=function(e){u.logging&&t.console&&t.console.log&&t.console.log(e)},u.Util.trimText=function(t){return function(e){return t?t.apply(e):((e||"")+"").replace(/^\s+|\s+$/g,"")}}(String.prototype.trim),u.Util.asFloat=function(t){return parseFloat(t)},function(){var t=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g,e=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g;u.Util.parseTextShadows=function(n){if(!n||"none"===n)return[];for(var r=n.match(t),a=[],o=0;r&&r.length>o;o++){var i=r[o].match(e);a.push({color:i[0],offsetX:i[1]?i[1].replace("px",""):0,offsetY:i[2]?i[2].replace("px",""):0,blur:i[3]?i[3].replace("px",""):0})}return a}}(),u.Util.parseBackgroundImage=function(t){var e,n,r,a,o,i,l,s,c=" \r\n ",d=[],u=0,h=0,f=function(){e&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)),n&&s.push(n),"-"===e.substr(0,1)&&(a=e.indexOf("-",1)+1)>0&&(r=e.substr(0,a),e=e.substr(a)),d.push({prefix:r,method:e.toLowerCase(),value:o,args:s})),s=[],e=r=n=o=""};f();for(var p=0,g=t.length;g>p;p++)if(i=t[p],!(0===u&&c.indexOf(i)>-1)){switch(i){case'"':l?l===i&&(l=null):l=i;break;case"(":if(l)break;if(0===u){u=1,o+=i;continue}h++;break;case")":if(l)break;if(1===u){if(0===h){u=0,o+=i,f();continue}h--}break;case",":if(l)break;if(0===u){f();continue}if(1===u&&0===h&&!e.match(/^url$/i)){s.push(n),n="",o+=i;continue}}o+=i,0===u?e+=i:n+=i}return f(),d},u.Util.Bounds=function(t){var e,n={};return t.getBoundingClientRect&&(e=t.getBoundingClientRect(),n.top=e.top,n.bottom=e.bottom||e.top+e.height,n.left=e.left,n.width=t.offsetWidth,n.height=t.offsetHeight),n},u.Util.OffsetBounds=function(t){var e=t.offsetParent?u.Util.OffsetBounds(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}},u.Util.getCSS=function(t,n,r){c!==t&&(d=e.defaultView.getComputedStyle(t,null));var i=d[n];if(/^background(Size|Position)$/.test(n))return o(i,t,n,r);if(/border(Top|Bottom)(Left|Right)Radius/.test(n)){var l=i.split(" ");return 1>=l.length&&(l[1]=l[0]),l.map(a)}return i},u.Util.resizeBounds=function(t,e,n,r,a){var o,i,l=n/r,s=t/e;return a&&"auto"!==a?s>l^"contain"===a?(i=r,o=r*s):(o=n,i=n/s):(o=n,i=r),{width:o,height:i}},u.Util.BackgroundPosition=function(t,e,n,r,a){var o=i("backgroundPosition",t,e,n,r,a);return{left:o[0],top:o[1]}},u.Util.BackgroundSize=function(t,e,n,r){var a=i("backgroundSize",t,e,n,r);return{width:a[0],height:a[1]}},u.Util.Extend=function(t,e){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},u.Util.Children=function(t){var e;try{e=t.nodeName&&"IFRAME"===t.nodeName.toUpperCase()?t.contentDocument||t.contentWindow.document:function(t){var e=[];return null!==t&&function(t,e){var r=t.length,a=0;if("number"==typeof e.length)for(var o=e.length;o>a;a++)t[r++]=e[a];else for(;e[a]!==n;)t[r++]=e[a++];return t.length=r,t}(e,t),e}(t.childNodes)}catch(r){u.Util.log("html2canvas.Util.Children failed with exception: "+r.message),e=[]}return e},u.Util.isTransparent=function(t){return"transparent"===t||"rgba(0, 0, 0, 0)"===t},u.Util.Font=function(){var t={};return function(e,r,a){if(t[e+"-"+r]!==n)return t[e+"-"+r];var o,i,l,s=a.createElement("div"),c=a.createElement("img"),d=a.createElement("span"),u="Hidden Text";return s.style.visibility="hidden",s.style.fontFamily=e,s.style.fontSize=r,s.style.margin=0,s.style.padding=0,a.body.appendChild(s),c.src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=",c.width=1,c.height=1,c.style.margin=0,c.style.padding=0,c.style.verticalAlign="baseline",d.style.fontFamily=e,d.style.fontSize=r,d.style.margin=0,d.style.padding=0,d.appendChild(a.createTextNode(u)),s.appendChild(d),s.appendChild(c),o=c.offsetTop-d.offsetTop+1,s.removeChild(d),s.appendChild(a.createTextNode(u)),s.style.lineHeight="normal",c.style.verticalAlign="super",i=c.offsetTop-s.offsetTop+1,l={baseline:o,lineWidth:1,middle:i},t[e+"-"+r]=l,a.body.removeChild(s),l}}(),function(){function t(t){return function(e){try{t.addColorStop(e.stop,e.color)}catch(r){n.log(["failed to add color stop: ",r,"; tried to add: ",e])}}}var n=u.Util,r={};u.Generate=r;var a=[/^(-webkit-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-gradient)\((linear|radial),\s((?:\d{1,3}%?)\s(?:\d{1,3}%?),\s(?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)\-]+)\)$/,/^(-moz-linear-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-moz-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s?([a-z\-]*)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/];r.parseGradient=function(t,e){var n,r,o,i,l,s,c,d,u,h,f,p,g=a.length;for(r=0;g>r&&!(o=t.match(a[r]));r+=1);if(o)switch(o[1]){case"-webkit-linear-gradient":case"-o-linear-gradient":if(n={type:"linear",x0:null,y0:null,x1:null,y1:null,colorStops:[]},l=o[2].match(/\w+/g))for(s=l.length,r=0;s>r;r+=1)switch(l[r]){case"top":n.y0=0,n.y1=e.height;break;case"right":n.x0=e.width,n.x1=0;break;case"bottom":n.y0=e.height,n.y1=0;break;case"left":n.x0=0,n.x1=e.width}if(null===n.x0&&null===n.x1&&(n.x0=n.x1=e.width/2),null===n.y0&&null===n.y1&&(n.y0=n.y1=e.height/2),l=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g))for(s=l.length,c=1/Math.max(s-1,1),r=0;s>r;r+=1)d=l[r].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),d[2]?(i=parseFloat(d[2]),i/="%"===d[3]?100:e.width):i=r*c,n.colorStops.push({color:d[1],stop:i});break;case"-webkit-gradient":if(n={type:"radial"===o[2]?"circle":o[2],x0:0,y0:0,x1:0,y1:0,colorStops:[]},l=o[3].match(/(\d{1,3})%?\s(\d{1,3})%?,\s(\d{1,3})%?\s(\d{1,3})%?/),l&&(n.x0=l[1]*e.width/100,n.y0=l[2]*e.height/100,n.x1=l[3]*e.width/100,n.y1=l[4]*e.height/100),l=o[4].match(/((?:from|to|color-stop)\((?:[0-9\.]+,\s)?(?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)\))+/g))for(s=l.length,r=0;s>r;r+=1)d=l[r].match(/(from|to|color-stop)\(([0-9\.]+)?(?:,\s)?((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\)/),i=parseFloat(d[2]),"from"===d[1]&&(i=0),"to"===d[1]&&(i=1),n.colorStops.push({color:d[3],stop:i});break;case"-moz-linear-gradient":if(n={type:"linear",x0:0,y0:0,x1:0,y1:0,colorStops:[]},l=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),l&&(n.x0=l[1]*e.width/100,n.y0=l[2]*e.height/100,n.x1=e.width-n.x0,n.y1=e.height-n.y0),l=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}%)?)+/g))for(s=l.length,c=1/Math.max(s-1,1),r=0;s>r;r+=1)d=l[r].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/),d[2]?(i=parseFloat(d[2]),d[3]&&(i/=100)):i=r*c,n.colorStops.push({color:d[1],stop:i});break;case"-webkit-radial-gradient":case"-moz-radial-gradient":case"-o-radial-gradient":if(n={type:"circle",x0:0,y0:0,x1:e.width,y1:e.height,cx:0,cy:0,rx:0,ry:0,colorStops:[]},l=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/),l&&(n.cx=l[1]*e.width/100,n.cy=l[2]*e.height/100),l=o[3].match(/\w+/),d=o[4].match(/[a-z\-]*/),l&&d)switch(d[0]){case"farthest-corner":case"cover":case"":u=Math.sqrt(Math.pow(n.cx,2)+Math.pow(n.cy,2)),h=Math.sqrt(Math.pow(n.cx,2)+Math.pow(n.y1-n.cy,2)),f=Math.sqrt(Math.pow(n.x1-n.cx,2)+Math.pow(n.y1-n.cy,2)),p=Math.sqrt(Math.pow(n.x1-n.cx,2)+Math.pow(n.cy,2)),n.rx=n.ry=Math.max(u,h,f,p);break;case"closest-corner":u=Math.sqrt(Math.pow(n.cx,2)+Math.pow(n.cy,2)),h=Math.sqrt(Math.pow(n.cx,2)+Math.pow(n.y1-n.cy,2)),f=Math.sqrt(Math.pow(n.x1-n.cx,2)+Math.pow(n.y1-n.cy,2)),p=Math.sqrt(Math.pow(n.x1-n.cx,2)+Math.pow(n.cy,2)),n.rx=n.ry=Math.min(u,h,f,p);break;case"farthest-side":"circle"===l[0]?n.rx=n.ry=Math.max(n.cx,n.cy,n.x1-n.cx,n.y1-n.cy):(n.type=l[0],n.rx=Math.max(n.cx,n.x1-n.cx),n.ry=Math.max(n.cy,n.y1-n.cy));break;case"closest-side":case"contain":"circle"===l[0]?n.rx=n.ry=Math.min(n.cx,n.cy,n.x1-n.cx,n.y1-n.cy):(n.type=l[0],n.rx=Math.min(n.cx,n.x1-n.cx),n.ry=Math.min(n.cy,n.y1-n.cy))}if(l=o[5].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g))for(s=l.length,c=1/Math.max(s-1,1),r=0;s>r;r+=1)d=l[r].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/),d[2]?(i=parseFloat(d[2]),i/="%"===d[3]?100:e.width):i=r*c,n.colorStops.push({color:d[1],stop:i})}return n},r.Gradient=function(n,r){if(0!==r.width&&0!==r.height){var a,o,i=e.createElement("canvas"),l=i.getContext("2d");if(i.width=r.width,i.height=r.height,a=u.Generate.parseGradient(n,r))switch(a.type){case"linear":o=l.createLinearGradient(a.x0,a.y0,a.x1,a.y1),a.colorStops.forEach(t(o)),l.fillStyle=o,l.fillRect(0,0,r.width,r.height);break;case"circle":o=l.createRadialGradient(a.cx,a.cy,0,a.cx,a.cy,a.rx),a.colorStops.forEach(t(o)),l.fillStyle=o,l.fillRect(0,0,r.width,r.height);break;case"ellipse":var s=e.createElement("canvas"),c=s.getContext("2d"),d=Math.max(a.rx,a.ry),h=2*d;s.width=s.height=h,o=c.createRadialGradient(a.rx,a.ry,0,a.rx,a.ry,d),a.colorStops.forEach(t(o)),c.fillStyle=o,c.fillRect(0,0,h,h),l.fillStyle=a.colorStops[a.colorStops.length-1].color,l.fillRect(0,0,i.width,i.height),l.drawImage(s,a.cx-a.rx,a.cy-a.ry,2*a.rx,2*a.ry)}return i}},r.ListAlpha=function(t){var e,n="";do e=t%26,n=String.fromCharCode(e+64)+n,t/=26;while(26*t>26);return n},r.ListRoman=function(t){var e,n=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"],r=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a="",o=n.length;if(0>=t||t>=4e3)return t;for(e=0;o>e;e+=1)for(;t>=r[e];)t-=r[e],a+=n[e];return a}}(),u.Parse=function(r,a){function o(){return Math.max(Math.max(de.body.scrollWidth,de.documentElement.scrollWidth),Math.max(de.body.offsetWidth,de.documentElement.offsetWidth),Math.max(de.body.clientWidth,de.documentElement.clientWidth))}function i(){return Math.max(Math.max(de.body.scrollHeight,de.documentElement.scrollHeight),Math.max(de.body.offsetHeight,de.documentElement.offsetHeight),Math.max(de.body.clientHeight,de.documentElement.clientHeight))}function c(t,e){var n=parseInt(ge(t,e),10);return isNaN(n)?0:n}function d(t,e,n,r,a,o){"transparent"!==o&&(t.setVariable("fillStyle",o),t.fillRect(e,n,r,a),ce+=1)}function h(t,e,r){return t.length>0?e+r.toUpperCase():n}function f(t,e){switch(e){case"lowercase":return t.toLowerCase();case"capitalize":return t.replace(/(^|\s|:|-|\(|\))([a-z])/g,h);case"uppercase":return t.toUpperCase();default:return t}}function p(t){return/^(normal|none|0px)$/.test(t)}function g(t,e,n,r){null!==t&&ue.trimText(t).length>0&&(r.fillText(t,e,n),ce+=1)}function m(t,e,r,a){var o=!1,i=ge(e,"fontWeight"),l=ge(e,"fontFamily"),s=ge(e,"fontSize"),c=ue.parseTextShadows(ge(e,"textShadow"));switch(parseInt(i,10)){case 401:i="bold";break;case 400:i="normal"}return t.setVariable("fillStyle",a),t.setVariable("font",[ge(e,"fontStyle"),ge(e,"fontVariant"),i,s,l].join(" ")),t.setVariable("textAlign",o?"right":"left"),c.length&&(t.setVariable("shadowColor",c[0].color),t.setVariable("shadowOffsetX",c[0].offsetX),t.setVariable("shadowOffsetY",c[0].offsetY),t.setVariable("shadowBlur",c[0].blur)),"none"!==r?ue.Font(l,s,de):n}function y(t,e,n,r,a){switch(e){case"underline":d(t,n.left,Math.round(n.top+r.baseline+r.lineWidth),n.width,1,a);break;case"overline":d(t,n.left,Math.round(n.top),n.width,1,a);break;case"line-through":d(t,n.left,Math.ceil(n.top+r.middle+r.lineWidth),n.width,1,a)}}function b(t,e,n,r,a){var o;if(he.rangeBounds&&!a)("none"!==n||0!==ue.trimText(e).length)&&(o=w(e,t.node,t.textOffset)),t.textOffset+=e.length;else if(t.node&&"string"==typeof t.node.nodeValue){var i=r?t.node.splitText(e.length):null;o=x(t.node,a),t.node=i}return o}function w(t,e,n){var r=de.createRange();return r.setStart(e,n),r.setEnd(e,n+t.length),r.getBoundingClientRect()}function x(t,e){var n=t.parentNode,r=de.createElement("wrapper"),a=t.cloneNode(!0);r.appendChild(t.cloneNode(!0)),n.replaceChild(r,t);var o=e?ue.OffsetBounds(r):ue.Bounds(r);return n.replaceChild(a,r),o}function v(t,e,n){var r,o,i=n.ctx,l=ge(t,"color"),s=ge(t,"textDecoration"),c=ge(t,"textAlign"),d={node:e,textOffset:0};ue.trimText(e.nodeValue).length>0&&(e.nodeValue=f(e.nodeValue,ge(t,"textTransform")),c=c.replace(["-webkit-auto"],["auto"]),o=!a.letterRendering&&/^(left|right|justify|auto)$/.test(c)&&p(ge(t,"letterSpacing"))?e.nodeValue.split(/(\b| )/):e.nodeValue.split(""),r=m(i,t,s,l),a.chinese&&o.forEach(function(t,e){/.*[\u4E00-\u9FA5].*$/.test(t)&&(t=t.split(""),t.unshift(e,1),o.splice.apply(o,t))}),o.forEach(function(t,e){var a=b(d,t,s,o.length-1>e,n.transform.matrix);a&&(g(t,a.left,a.bottom,i),y(i,s,a,r,l))}))}function k(t,e){var n,r,a=de.createElement("boundelement");return a.style.display="inline",n=t.style.listStyleType,t.style.listStyleType="none",a.appendChild(de.createTextNode(e)),t.insertBefore(a,t.firstChild),r=ue.Bounds(a),t.removeChild(a),t.style.listStyleType=n,r}function C(t){var e=-1,n=1,r=t.parentNode.childNodes;if(t.parentNode){for(;r[++e]!==t;)1===r[e].nodeType&&n++;return n}return-1}function T(t,e){var n,r=C(t);switch(e){case"decimal":n=r;break;case"decimal-leading-zero":n=1===(""+r).length?r="0"+(""+r):""+r;break;case"upper-roman":n=u.Generate.ListRoman(r);break;case"lower-roman":n=u.Generate.ListRoman(r).toLowerCase();break;case"lower-alpha":n=u.Generate.ListAlpha(r).toLowerCase();break;case"upper-alpha":n=u.Generate.ListAlpha(r)}return n+". "}function S(t,e,n){var r,a,o,i=e.ctx,l=ge(t,"listStyleType");if(/^(decimal|decimal-leading-zero|upper-alpha|upper-latin|upper-roman|lower-alpha|lower-greek|lower-latin|lower-roman)$/i.test(l)){if(a=T(t,l),o=k(t,a),m(i,t,"none",ge(t,"color")),"inside"!==ge(t,"listStylePosition"))return;i.setVariable("textAlign","left"),r=n.left,g(a,r,o.bottom,i)}}function M(t){var e=r[t];return e&&e.succeeded===!0?e.img:!1}function R(t,e){var n=Math.max(t.left,e.left),r=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height);return{left:n,top:r,width:a-n,height:o-r}}function E(t,e,n){var r,a="static"!==e.cssPosition,o=a?ge(t,"zIndex"):"auto",i=ge(t,"opacity"),l="none"!==ge(t,"cssFloat");e.zIndex=r=s(o),r.isPositioned=a,r.isFloated=l,r.opacity=i,r.ownStacking="auto"!==o||1>i,n&&n.zIndex.children.push(e)}function I(t,e,n,r,a){var o=c(e,"paddingLeft"),i=c(e,"paddingTop"),l=c(e,"paddingRight"),s=c(e,"paddingBottom");$(t,n,0,0,n.width,n.height,r.left+o+a[3].width,r.top+i+a[0].width,r.width-(a[1].width+a[3].width+o+l),r.height-(a[0].width+a[2].width+i+s))}function L(t){return["Top","Right","Bottom","Left"].map(function(e){return{width:c(t,"border"+e+"Width"),color:ge(t,"border"+e+"Color")}})}function O(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){return ge(t,"border"+e+"Radius")})}function z(t,e,n,r){var a=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:t,startControl:e,endControl:n,end:r,subdivide:function(o){var i=a(t,e,o),l=a(e,n,o),s=a(n,r,o),c=a(i,l,o),d=a(l,s,o),u=a(c,d,o);return[z(t,i,c,u),z(u,d,s,r)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,n.x,n.y,r.x,r.y])},curveToReversed:function(r){r.push(["bezierCurve",n.x,n.y,e.x,e.y,t.x,t.y])}}}function A(t,e,n,r,a,o,i){e[0]>0||e[1]>0?(t.push(["line",r[0].start.x,r[0].start.y]),r[0].curveTo(t),r[1].curveTo(t)):t.push(["line",o,i]),(n[0]>0||n[1]>0)&&t.push(["line",a[0].start.x,a[0].start.y])}function B(t,e,n,r,a,o,i){var l=[];return e[0]>0||e[1]>0?(l.push(["line",r[1].start.x,r[1].start.y]),r[1].curveTo(l)):l.push(["line",t.c1[0],t.c1[1]]),n[0]>0||n[1]>0?(l.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(l),l.push(["line",i[0].end.x,i[0].end.y]),i[0].curveToReversed(l)):(l.push(["line",t.c2[0],t.c2[1]]),l.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(l.push(["line",a[1].end.x,a[1].end.y]),a[1].curveToReversed(l)):l.push(["line",t.c4[0],t.c4[1]]),l}function U(t,e,n){var r=t.left,a=t.top,o=t.width,i=t.height,l=e[0][0],s=e[0][1],c=e[1][0],d=e[1][1],u=e[2][0],h=e[2][1],f=e[3][0],p=e[3][1],g=o-c,m=i-h,y=o-u,b=i-p;return{topLeftOuter:be(r,a,l,s).topLeft.subdivide(.5),topLeftInner:be(r+n[3].width,a+n[0].width,Math.max(0,l-n[3].width),Math.max(0,s-n[0].width)).topLeft.subdivide(.5),topRightOuter:be(r+g,a,c,d).topRight.subdivide(.5),topRightInner:be(r+Math.min(g,o+n[3].width),a+n[0].width,g>o+n[3].width?0:c-n[3].width,d-n[0].width).topRight.subdivide(.5),bottomRightOuter:be(r+y,a+m,u,h).bottomRight.subdivide(.5),bottomRightInner:be(r+Math.min(y,o+n[3].width),a+Math.min(m,i+n[0].width),Math.max(0,u-n[1].width),Math.max(0,h-n[2].width)).bottomRight.subdivide(.5),bottomLeftOuter:be(r,a+b,f,p).bottomLeft.subdivide(.5),bottomLeftInner:be(r+n[3].width,a+b,Math.max(0,f-n[3].width),Math.max(0,p-n[2].width)).bottomLeft.subdivide(.5)}}function N(t,e,n,r,a){var o=ge(t,"backgroundClip"),i=[];switch(o){case"content-box":case"padding-box":A(i,r[0],r[1],e.topLeftInner,e.topRightInner,a.left+n[3].width,a.top+n[0].width),A(i,r[1],r[2],e.topRightInner,e.bottomRightInner,a.left+a.width-n[1].width,a.top+n[0].width),A(i,r[2],r[3],e.bottomRightInner,e.bottomLeftInner,a.left+a.width-n[1].width,a.top+a.height-n[2].width),A(i,r[3],r[0],e.bottomLeftInner,e.topLeftInner,a.left+n[3].width,a.top+a.height-n[2].width);break;default:A(i,r[0],r[1],e.topLeftOuter,e.topRightOuter,a.left,a.top),A(i,r[1],r[2],e.topRightOuter,e.bottomRightOuter,a.left+a.width,a.top),A(i,r[2],r[3],e.bottomRightOuter,e.bottomLeftOuter,a.left+a.width,a.top+a.height),A(i,r[3],r[0],e.bottomLeftOuter,e.topLeftOuter,a.left,a.top+a.height)}return i}function P(t,e,n){var r,a,o,i,l,s,c=e.left,d=e.top,u=e.width,h=e.height,f=O(t),p=U(e,f,n),g={clip:N(t,p,n,f,e),borders:[]};for(r=0;4>r;r++)if(n[r].width>0){switch(a=c,o=d,i=u,l=h-n[2].width,r){case 0:l=n[0].width,s=B({c1:[a,o],c2:[a+i,o],c3:[a+i-n[1].width,o+l],c4:[a+n[3].width,o+l]},f[0],f[1],p.topLeftOuter,p.topLeftInner,p.topRightOuter,p.topRightInner);break;case 1:a=c+u-n[1].width,i=n[1].width,s=B({c1:[a+i,o],c2:[a+i,o+l+n[2].width],c3:[a,o+l],c4:[a,o+n[0].width]},f[1],f[2],p.topRightOuter,p.topRightInner,p.bottomRightOuter,p.bottomRightInner);break;case 2:o=o+h-n[2].width,l=n[2].width,s=B({c1:[a+i,o+l],c2:[a,o+l],c3:[a+n[3].width,o],c4:[a+i-n[3].width,o]},f[2],f[3],p.bottomRightOuter,p.bottomRightInner,p.bottomLeftOuter,p.bottomLeftInner);break;case 3:i=n[3].width,s=B({c1:[a,o+l+n[2].width],c2:[a,o],c3:[a+i,o+n[0].width],c4:[a+i,o+l]},f[3],f[0],p.bottomLeftOuter,p.bottomLeftInner,p.topLeftOuter,p.topLeftInner)}g.borders.push({args:s,color:n[r].color})}return g}function F(t,e){var n=t.drawShape();return e.forEach(function(t,e){n[0===e?"moveTo":t[0]+"To"].apply(null,t.slice(1))}),n}function V(t,e,n){"transparent"!==n&&(t.setVariable("fillStyle",n),F(t,e),t.fill(),ce+=1)}function D(t,e,n){var r,a,o=de.createElement("valuewrap"),i=["lineHeight","textAlign","fontFamily","color","fontSize","paddingLeft","paddingTop","width","height","border","borderLeftWidth","borderTopWidth"];i.forEach(function(e){try{o.style[e]=ge(t,e)}catch(n){ue.log("html2canvas: Parse: Exception caught in renderFormValue: "+n.message)}}),o.style.borderColor="black",o.style.borderStyle="solid",o.style.display="block",o.style.position="absolute",(/^(submit|reset|button|text|password)$/.test(t.type)||"SELECT"===t.nodeName)&&(o.style.lineHeight=ge(t,"height")),o.style.top=e.top+"px",o.style.left=e.left+"px",r="SELECT"===t.nodeName?(t.options[t.selectedIndex]||0).text:t.value,r||(r=t.placeholder),a=de.createTextNode(r),o.appendChild(a),pe.appendChild(o),v(t,a,n),pe.removeChild(o)}function $(t){t.drawImage.apply(t,Array.prototype.slice.call(arguments,1)),ce+=1}function G(n,r){var a=t.getComputedStyle(n,r);if(a&&a.content&&"none"!==a.content&&"-moz-alt-content"!==a.content&&"none"!==a.display){var o=a.content+"",i=o.substr(0,1);i===o.substr(o.length-1)&&i.match(/'|"/)&&(o=o.substr(1,o.length-2));var l="url"===o.substr(0,3),s=e.createElement(l?"img":"span");return s.className=me+"-before "+me+"-after",Object.keys(a).filter(W).forEach(function(t){try{s.style[t]=a[t]}catch(e){ue.log(["Tried to assign readonly property ",t,"Error:",e])}}),l?s.src=ue.parseBackgroundImage(o)[0].args[0]:s.innerHTML=o,s}}function W(e){return isNaN(t.parseInt(e,10))}function H(t,e){var n=G(t,":before"),r=G(t,":after");(n||r)&&(n&&(t.className+=" "+me+"-before",t.parentNode.insertBefore(n,t),oe(n,e,!0),t.parentNode.removeChild(n),t.className=t.className.replace(me+"-before","").trim()),r&&(t.className+=" "+me+"-after",t.appendChild(r),oe(r,e,!0),t.removeChild(r),t.className=t.className.replace(me+"-after","").trim()))}function j(t,e,n,r){var a=Math.round(r.left+n.left),o=Math.round(r.top+n.top);t.createPattern(e),t.translate(a,o),t.fill(),t.translate(-a,-o)}function q(t,e,n,r,a,o,i,l){var s=[];s.push(["line",Math.round(a),Math.round(o)]),s.push(["line",Math.round(a+i),Math.round(o)]),s.push(["line",Math.round(a+i),Math.round(l+o)]),s.push(["line",Math.round(a),Math.round(l+o)]),F(t,s),t.save(),t.clip(),j(t,e,n,r),t.restore()}function X(t,e,n){d(t,e.left,e.top,e.width,e.height,n)}function _(t,e,n,r,a){var o=ue.BackgroundSize(t,e,r,a),i=ue.BackgroundPosition(t,e,r,a,o),l=ge(t,"backgroundRepeat").split(",").map(ue.trimText);switch(r=Q(r,o),l=l[a]||l[0]){case"repeat-x":q(n,r,i,e,e.left,e.top+i.top,99999,r.height);break;case"repeat-y":q(n,r,i,e,e.left+i.left,e.top,r.width,99999);break;case"no-repeat":q(n,r,i,e,e.left+i.left,e.top+i.top,r.width,r.height);break;default:j(n,r,i,{top:e.top,left:e.left,width:r.width,height:r.height})}}function Y(t,e,n){for(var r,a=ge(t,"backgroundImage"),o=ue.parseBackgroundImage(a),i=o.length;i--;)if(a=o[i],a.args&&0!==a.args.length){var l="url"===a.method?a.args[0]:a.value;r=M(l),r?_(t,e,n,r,i):ue.log("html2canvas: Error loading background:",a)}}function Q(t,e){if(t.width===e.width&&t.height===e.height)return t;var n,r=de.createElement("canvas");return r.width=e.width,r.height=e.height,n=r.getContext("2d"),$(n,t,0,0,t.width,t.height,0,0,e.width,e.height),r}function J(t,e,n){return t.setVariable("globalAlpha",ge(e,"opacity")*(n?n.opacity:1))}function K(t){return t.replace("px","")}function Z(t){var e=ge(t,"transform")||ge(t,"-webkit-transform")||ge(t,"-moz-transform")||ge(t,"-ms-transform")||ge(t,"-o-transform"),n=ge(t,"transform-origin")||ge(t,"-webkit-transform-origin")||ge(t,"-moz-transform-origin")||ge(t,"-ms-transform-origin")||ge(t,"-o-transform-origin")||"0px 0px";n=n.split(" ").map(K).map(ue.asFloat);var r;if(e&&"none"!==e){var a=e.match(we);if(a)switch(a[1]){case"matrix":r=a[2].split(",").map(ue.trimText).map(ue.asFloat)}}return{origin:n,matrix:r}}function te(t,e,n,r){var s=l(e?n.width:o(),e?n.height:i()),c={ctx:s,opacity:J(s,t,e),cssPosition:ge(t,"position"),borders:L(t),transform:r,clip:e&&e.clip?ue.Extend({},e.clip):null};return E(t,c,e),a.useOverflow===!0&&/(hidden|scroll|auto)/.test(ge(t,"overflow"))===!0&&/(BODY)/i.test(t.nodeName)===!1&&(c.clip=c.clip?R(c.clip,n):n),c}function ee(t,e,n){var r={left:e.left+t[3].width,top:e.top+t[0].width,width:e.width-(t[1].width+t[3].width),height:e.height-(t[0].width+t[2].width)};return n&&(r=R(r,n)),r}function ne(t,e){var n=e.matrix?ue.OffsetBounds(t):ue.Bounds(t);return e.origin[0]+=n.left,e.origin[1]+=n.top,n}function re(t,e,n,r){var a,o=Z(t,e),i=ne(t,o),l=te(t,e,i,o),s=l.borders,c=l.ctx,d=ee(s,i,l.clip),u=P(t,i,s),h=fe.test(t.nodeName)?"#efefef":ge(t,"backgroundColor");switch(F(c,u.clip),c.save(),c.clip(),d.height>0&&d.width>0&&!r?(X(c,i,h),Y(t,d,c)):r&&(l.backgroundColor=h),c.restore(),u.borders.forEach(function(t){V(c,t.args,t.color)}),n||H(t,l),t.nodeName){case"IMG":(a=M(t.getAttribute("src")))?I(c,t,a,i,s):ue.log("html2canvas: Error loading :"+t.getAttribute("src"));break;case"INPUT":/^(text|url|email|submit|button|reset)$/.test(t.type)&&(t.value||t.placeholder||"").length>0&&D(t,i,l);break;case"TEXTAREA":(t.value||t.placeholder||"").length>0&&D(t,i,l);break;case"SELECT":(t.options||t.placeholder||"").length>0&&D(t,i,l);break;case"LI":S(t,l,d);break;case"CANVAS":I(c,t,t,i,s)}return l}function ae(t){return"none"!==ge(t,"display")&&"hidden"!==ge(t,"visibility")&&!t.hasAttribute("data-html2canvas-ignore")}function oe(t,e,n){ae(t)&&(e=re(t,e,n,!1)||e,fe.test(t.nodeName)||ie(t,e,n))}function ie(t,e,n){ue.Children(t).forEach(function(r){r.nodeType===r.ELEMENT_NODE?oe(r,e,n):r.nodeType===r.TEXT_NODE&&v(t,r,e)})}function le(){var t=ge(e.documentElement,"backgroundColor"),n=ue.isTransparent(t)&&se===e.body,r=re(se,null,!1,n);return ie(se,r),n&&(t=r.backgroundColor),pe.removeChild(ye),{backgroundColor:t,stack:r}}t.scroll(0,0);var se=a.elements===n?e.body:a.elements[0],ce=0,de=se.ownerDocument,ue=u.Util,he=ue.Support(a,de),fe=RegExp("("+a.ignoreElements+")"),pe=de.body,ge=ue.getCSS,me="___html2canvas___pseudoelement",ye=de.createElement("style");ye.innerHTML="."+me+'-before:before { content: "" !important; display: none !important; }'+"."+me+'-after:after { content: "" !important; display: none !important; }',pe.appendChild(ye),r=r||{};var be=function(t){return function(e,n,r,a){var o=r*t,i=a*t,l=e+r,s=n+a;return{topLeft:z({x:e,y:s},{x:e,y:s-i},{x:l-o,y:n},{x:l,y:n}),topRight:z({x:e,y:n},{x:e+o,y:n},{x:l,y:s-i},{x:l,y:s}),bottomRight:z({x:l,y:n},{x:l,y:n+i},{x:e+o,y:s},{x:e,y:s}),bottomLeft:z({x:l,y:s},{x:l-o,y:s},{x:e,y:n+i},{x:e,y:n})}}}(4*((Math.sqrt(2)-1)/3)),we=/(matrix)\((.+)\)/;return le()},u.Preload=function(r){function a(t){M.href=t,M.href=M.href;var e=M.protocol+M.host;return e===g}function o(){x.log("html2canvas: start: images: "+w.numLoaded+" / "+w.numTotal+" (failed: "+w.numFailed+")"),!w.firstRun&&w.numLoaded>=w.numTotal&&(x.log("Finished loading images: # "+w.numTotal+" (failed: "+w.numFailed+")"),"function"==typeof r.complete&&r.complete(w))}function i(e,a,i){var l,s,c=r.proxy;M.href=e,e=M.href,l="html2canvas_"+v++,i.callbackname=l,c+=c.indexOf("?")>-1?"&":"?",c+="url="+encodeURIComponent(e)+"&callback="+l,s=C.createElement("script"),t[l]=function(e){"error:"===e.substring(0,6)?(i.succeeded=!1,w.numLoaded++,w.numFailed++,o()):(p(a,i),a.src=e),t[l]=n;try{delete t[l]}catch(r){}s.parentNode.removeChild(s),s=null,delete i.script,delete i.callbackname},s.setAttribute("type","text/javascript"),s.setAttribute("src",c),i.script=s,t.document.body.appendChild(s)}function l(e,n){var r=t.getComputedStyle(e,n),a=r.content;"url"===a.substr(0,3)&&m.loadImage(u.Util.parseBackgroundImage(a)[0].args[0]),h(r.backgroundImage,e)}function s(t){l(t,":before"),l(t,":after")}function c(t,e){var r=u.Generate.Gradient(t,e);r!==n&&(w[t]={img:r,succeeded:!0},w.numTotal++,w.numLoaded++,o())}function d(t){return t&&t.method&&t.args&&t.args.length>0}function h(t,e){var r;u.Util.parseBackgroundImage(t).filter(d).forEach(function(t){"url"===t.method?m.loadImage(t.args[0]):t.method.match(/\-?gradient$/)&&(r===n&&(r=u.Util.Bounds(e)),c(t.value,r))})}function f(t){var e=!1;try{x.Children(t).forEach(f)}catch(r){}try{e=t.nodeType}catch(a){e=!1,x.log("html2canvas: failed to access some element's nodeType - Exception: "+a.message)}if(1===e||e===n){s(t);try{h(x.getCSS(t,"backgroundImage"),t)}catch(r){x.log("html2canvas: failed to get background-image - Exception: "+r.message)}h(t)}}function p(e,a){e.onload=function(){a.timer!==n&&t.clearTimeout(a.timer),w.numLoaded++,a.succeeded=!0,e.onerror=e.onload=null,o()},e.onerror=function(){if("anonymous"===e.crossOrigin&&(t.clearTimeout(a.timer),r.proxy)){var l=e.src;return e=new Image,a.img=e,e.src=l,i(e.src,e,a),n}w.numLoaded++,w.numFailed++,a.succeeded=!1,e.onerror=e.onload=null,o()}}var g,m,y,b,w={numLoaded:0,numFailed:0,numTotal:0,cleanupDone:!1},x=u.Util,v=0,k=r.elements[0]||e.body,C=k.ownerDocument,T=k.getElementsByTagName("img"),S=T.length,M=C.createElement("a"),R=function(t){return t.crossOrigin!==n}(new Image);for(M.href=t.location.href,g=M.protocol+M.host,m={loadImage:function(t){var e,o;t&&w[t]===n&&(e=new Image,t.match(/data:image\/.*;base64,/i)?(e.src=t.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),o=w[t]={img:e},w.numTotal++,p(e,o)):a(t)||r.allowTaint===!0?(o=w[t]={img:e},w.numTotal++,p(e,o),e.src=t):R&&!r.allowTaint&&r.useCORS?(e.crossOrigin="anonymous",o=w[t]={img:e},w.numTotal++,p(e,o),e.src=t):r.proxy&&(o=w[t]={img:e},w.numTotal++,i(t,e,o)))},cleanupDOM:function(a){var i,l;if(!w.cleanupDone){a&&"string"==typeof a?x.log("html2canvas: Cleanup because: "+a):x.log("html2canvas: Cleanup after timeout: "+r.timeout+" ms.");for(l in w)if(w.hasOwnProperty(l)&&(i=w[l],"object"==typeof i&&i.callbackname&&i.succeeded===n)){t[i.callbackname]=n;try{delete t[i.callbackname]}catch(s){}i.script&&i.script.parentNode&&(i.script.setAttribute("src","about:blank"),i.script.parentNode.removeChild(i.script)),w.numLoaded++,w.numFailed++,x.log("html2canvas: Cleaned up failed img: '"+l+"' Steps: "+w.numLoaded+" / "+w.numTotal)}t.stop!==n?t.stop():e.execCommand!==n&&e.execCommand("Stop",!1),e.close!==n&&e.close(),w.cleanupDone=!0,a&&"string"==typeof a||o()}},renderingDone:function(){b&&t.clearTimeout(b)}},r.timeout>0&&(b=t.setTimeout(m.cleanupDOM,r.timeout)),x.log("html2canvas: Preload starts: finding background-images"),w.firstRun=!0,f(k),x.log("html2canvas: Preload: Finding images"),y=0;S>y;y+=1)m.loadImage(T[y].getAttribute("src"));return w.firstRun=!1,x.log("html2canvas: Preload: Done."),w.numTotal===w.numLoaded&&o(),m},u.Renderer=function(t,r){function a(t){function e(t){Object.keys(t).sort().forEach(function(n){var r=[],o=[],i=[],l=[]; 8 | t[n].forEach(function(t){t.node.zIndex.isPositioned||1>t.node.zIndex.opacity?i.push(t):t.node.zIndex.isFloated?o.push(t):r.push(t)}),function s(t){t.forEach(function(t){l.push(t),t.children&&s(t.children)})}(r.concat(o,i)),l.forEach(function(t){t.context?e(t.context):a.push(t.node)})})}var r,a=[];return r=function(t){function e(t,r,a){var o="auto"===r.zIndex.zindex?0:Number(r.zIndex.zindex),i=t,l=r.zIndex.isPositioned,s=r.zIndex.isFloated,c={node:r},d=a;r.zIndex.ownStacking?(i=c.context={"!":[{node:r,children:[]}]},d=n):(l||s)&&(d=c.children=[]),0===o&&a?a.push(c):(t[o]||(t[o]=[]),t[o].push(c)),r.zIndex.children.forEach(function(t){e(i,t,d)})}var r={};return e(r,t),r}(t),e(r),a}function o(t){var e;if("string"==typeof r.renderer&&u.Renderer[t]!==n)e=u.Renderer[t](r);else{if("function"!=typeof t)throw Error("Unknown renderer");e=t(r)}if("function"!=typeof e)throw Error("Invalid renderer defined");return e}return o(r.renderer)(t,r,e,a(t.stack),u)},u.Util.Support=function(t,e){function r(){var t=new Image,r=e.createElement("canvas"),a=r.getContext===n?!1:r.getContext("2d");if(a===!1)return!1;r.width=r.height=10,t.src=["data:image/svg+xml,","","","
","sup","
","
","
"].join("");try{a.drawImage(t,0,0),r.toDataURL()}catch(o){return!1}return u.Util.log("html2canvas: Parse: SVG powered rendering available"),!0}function a(){var t,n,r,a,o=!1;return e.createRange&&(t=e.createRange(),t.getBoundingClientRect&&(n=e.createElement("boundtest"),n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n),r=t.getBoundingClientRect(),a=r.height,123===a&&(o=!0),e.body.removeChild(n))),o}return{rangeBounds:a(),svgRendering:t.svgRendering&&r()}},t.html2canvas=function(e,n){e=e.length?e:[e];var r,a,o={logging:!1,elements:e,background:"#fff",proxy:null,timeout:0,useCORS:!1,allowTaint:!1,svgRendering:!1,ignoreElements:"IFRAME|OBJECT|PARAM",useOverflow:!0,letterRendering:!1,chinese:!1,width:null,height:null,taintTest:!0,renderer:"Canvas"};return o=u.Util.Extend(n,o),u.logging=o.logging,o.complete=function(t){("function"!=typeof o.onpreloaded||o.onpreloaded(t)!==!1)&&(r=u.Parse(t,o),("function"!=typeof o.onparsed||o.onparsed(r)!==!1)&&(a=u.Renderer(r,o),"function"==typeof o.onrendered&&o.onrendered(a)))},t.setTimeout(function(){u.Preload(o)},0),{render:function(t,e){return u.Renderer(t,u.Util.Extend(e,o))},parse:function(t,e){return u.Parse(t,u.Util.Extend(e,o))},preload:function(t){return u.Preload(u.Util.Extend(t,o))},log:u.Util.log}},t.html2canvas.log=u.Util.log,t.html2canvas.Renderer={Canvas:n},u.Renderer.Canvas=function(t){function r(t,e){t.beginPath(),e.forEach(function(e){t[e.name].apply(t,e.arguments)}),t.closePath()}function a(t){if(-1===l.indexOf(t.arguments[0].src)){c.drawImage(t.arguments[0],0,0);try{c.getImageData(0,0,1,1)}catch(e){return s=i.createElement("canvas"),c=s.getContext("2d"),!1}l.push(t.arguments[0].src)}return!0}function o(e,n){switch(n.type){case"variable":e[n.name]=n.arguments;break;case"function":switch(n.name){case"createPattern":if(n.arguments[0].width>0&&n.arguments[0].height>0)try{e.fillStyle=e.createPattern(n.arguments[0],"repeat")}catch(o){d.log("html2canvas: Renderer: Error creating pattern",o.message)}break;case"drawShape":r(e,n.arguments);break;case"drawImage":n.arguments[8]>0&&n.arguments[7]>0&&(!t.taintTest||t.taintTest&&a(n))&&e.drawImage.apply(e,n.arguments);break;default:e[n.name].apply(e,n.arguments)}}}t=t||{};var i=e,l=[],s=e.createElement("canvas"),c=s.getContext("2d"),d=u.Util,h=t.canvas||i.createElement("canvas");return function(t,e,r,a,i){var l,s,c,u=h.getContext("2d"),f=t.stack;return h.width=h.style.width=e.width||f.ctx.width,h.height=h.style.height=e.height||f.ctx.height,c=u.fillStyle,u.fillStyle=d.isTransparent(f.backgroundColor)&&e.background!==n?e.background:t.backgroundColor,u.fillRect(0,0,h.width,h.height),u.fillStyle=c,a.forEach(function(t){u.textBaseline="bottom",u.save(),t.transform.matrix&&(u.translate(t.transform.origin[0],t.transform.origin[1]),u.transform.apply(u,t.transform.matrix),u.translate(-t.transform.origin[0],-t.transform.origin[1])),t.clip&&(u.beginPath(),u.rect(t.clip.left,t.clip.top,t.clip.width,t.clip.height),u.clip()),t.ctx.storage&&t.ctx.storage.forEach(function(t){o(u,t)}),u.restore()}),d.log("html2canvas: Renderer: Canvas renderer done - returning canvas obj"),1===e.elements.length&&"object"==typeof e.elements[0]&&"BODY"!==e.elements[0].nodeName?(s=i.Util.Bounds(e.elements[0]),l=r.createElement("canvas"),l.width=Math.ceil(s.width),l.height=Math.ceil(s.height),u=l.getContext("2d"),u.drawImage(h,s.left,s.top,s.width,s.height,0,0,s.width,s.height),h=null,l):h}}})(window,document); --------------------------------------------------------------------------------