imperavi-rails 0.0.3.beta → 0.0.4.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +33 -29
- data/app/assets/javascripts/imperavi-rails/imperavi/redactor.js +317 -405
- data/app/assets/stylesheets/imperavi-rails/imperavi/redactor.css.scss +1 -1
- data/app/views/imperavi_rails/imperavi/image_edit.html.erb +1 -1
- data/lib/imperavi-rails/controller_methods.rb +35 -0
- data/lib/imperavi-rails/version.rb +1 -1
- data/lib/imperavi-rails.rb +9 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/log/development.log +12384 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_44_32_721_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_44_32_721_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_45_23_25_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_45_23_25_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_45_49_374_15744.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_45_49_374_15744.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_50_20_902_4.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/03/14_50_20_902_4.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_22_15_373_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_22_15_373_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_22_40_820_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_22_40_820_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_23_30_325_3.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_23_30_325_3.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_23_57_376_4.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_23_57_376_4.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_26_27_220_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_26_27_220_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_26_57_55_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_26_57_55_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_27_58_370_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_27_58_370_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_29_07_700_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_29_07_700_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_29_19_327_4.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_29_19_327_4.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_29_53_813_4.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_29_53_813_4.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_30_13_242_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_30_13_242_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_30_19_927_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_30_19_927_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_14_355_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_14_355_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_19_371_1.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_19_371_1.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_28_432_15750.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_28_432_15750.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_39_821_15720.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_39_821_15720.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_47_624_4.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_31_47_624_4.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_33_26_155_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_33_26_155_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_34_29_787_2_small.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_34_29_787_2_small.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_34_35_450_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_34_35_450_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_34_41_340_15744.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_34_41_340_15744.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_38_14_325_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_38_14_325_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_45_06_883_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_45_06_883_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_45_18_915_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_45_18_915_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_45_46_86_15744.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_45_46_86_15744.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_47_24_195_3.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_47_24_195_3.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_47_46_83_5.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_47_46_83_5.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_51_18_603_15720.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_51_18_603_15720.jpg.meta +3 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_51_57_666_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_51_57_666_6.jpg.meta +4 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_53_25_938_6.jpg +0 -0
- data/spec/dummy/public/system/dragonfly/development/2012/02/17/19_53_25_938_6.jpg.meta +4 -0
- data/spec/dummy/tmp/cache/assets/CA9/BC0/sprockets%2F85d8b987b980454101a1236fdec2c220 +0 -0
- data/spec/dummy/tmp/cache/assets/CBE/FC0/sprockets%2Ff5431a64e341b062b7530132a5c1ea5a +2306 -1667
- data/spec/dummy/tmp/cache/assets/CC5/C10/sprockets%2F7c81f5c40dc9b87819488e127f487a04 +447 -369
- data/spec/dummy/tmp/cache/assets/CD5/530/sprockets%2F8d4c18bd4851f107c450a2c782301f8b +53 -0
- data/spec/dummy/tmp/cache/assets/CD7/EF0/sprockets%2Fc22597dc7c74137ba100f08542fec580 +76 -0
- data/spec/dummy/tmp/cache/assets/D09/DB0/sprockets%2F5ad1bbd0a458985447fac962fb121264 +188 -0
- data/spec/dummy/tmp/cache/assets/D1A/AB0/sprockets%2F05ea78f209b93ef03f29e933625b7fa5 +305 -1
- data/spec/dummy/tmp/cache/assets/D33/480/sprockets%2Fec072121b559132efe7d07cac0e991a5 +106 -0
- data/spec/dummy/tmp/cache/assets/D38/5D0/sprockets%2F7913f60d743aeb957af7a0ca5a20059d +0 -0
- data/spec/dummy/tmp/cache/assets/D43/830/sprockets%2Fe09848481135db1a4a5c783a7dc94fbd +50 -0
- data/spec/dummy/tmp/cache/assets/D59/260/sprockets%2Fd513a46ce8d83f003a733cb306dfe01a +317 -406
- data/spec/dummy/tmp/cache/assets/D64/190/sprockets%2Ffdfa1bbf71247a2b9ef0b97732603e02 +0 -0
- data/spec/dummy/tmp/cache/assets/D66/200/sprockets%2Fb343cda49d5d41a82c10a8f06d986bd2 +45 -0
- data/spec/dummy/tmp/cache/assets/D6B/980/sprockets%2F56c37f49f60073a401fcbd529dcaa74e +222 -0
- data/spec/dummy/tmp/cache/assets/D6D/AF0/sprockets%2F5a1aa4e3f7d7008e775019dfef3282cc +97 -0
- data/spec/dummy/tmp/cache/assets/D76/560/sprockets%2Fe0c5141697a090ffb74c9412e6dd7fef +50 -0
- data/spec/dummy/tmp/cache/assets/D95/E80/sprockets%2F844edf25b78967cbe9cf3e969c37c6c7 +0 -0
- data/spec/dummy/tmp/cache/assets/D96/230/sprockets%2F63e1b63e2b03d0bd6aaebd27c9973e91 +248 -1
- data/spec/dummy/tmp/cache/assets/D9B/E30/sprockets%2Fd87c8ca46743542cace533cfe91ae1d0 +437 -365
- data/spec/dummy/tmp/cache/assets/D9B/FF0/sprockets%2Fd8bbace39747d4af921e0534736baea3 +125 -0
- data/spec/dummy/tmp/cache/assets/DA2/970/sprockets%2F0d4ef1d42ee3e36fedcd979b3506525b +881 -1
- data/spec/dummy/tmp/cache/assets/DA8/F60/sprockets%2Fbb2cd57d63160c94d622ef9d91ccef68 +5 -5
- data/spec/dummy/tmp/cache/assets/DAC/140/sprockets%2F7a814a5598eaaaccf7ab7895f5663ad5 +89 -0
- data/spec/dummy/tmp/cache/assets/DB7/F90/sprockets%2Faf8cc6b28a790c7e3bd686e8ab9973c8 +0 -0
- data/spec/dummy/tmp/cache/assets/DBB/960/sprockets%2Fe20156d5decfaaea9d1e09f14a100f19 +16 -0
- data/spec/dummy/tmp/cache/sass/bc54e898614d486bf9338d646e8cd056915d4779/redactor.css.scssc +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/01/8b80e42551d33aed663f5757b3e4d3789383e6 +2359 -0
- data/spec/dummy/tmp/dragonfly/cache/body/02/3133eaaddaa68515039bc51e11b3bca2ad3f23 +986 -0
- data/spec/dummy/tmp/dragonfly/cache/body/03/13c061439229cdbd19215cbd1cf0e26441fac2 +713 -0
- data/spec/dummy/tmp/dragonfly/cache/body/05/024188cd40feb026eb8ccd15985d890ba9c84e +643 -0
- data/spec/dummy/tmp/dragonfly/cache/body/06/e22ab9a18784ce1f20e09401ee38b9672860d9 +697 -0
- data/spec/dummy/tmp/dragonfly/cache/body/07/f49938e6a88e40d2d6fd9fc613578396148e1d +1014 -0
- data/spec/dummy/tmp/dragonfly/cache/body/08/8e8a8fc07862b6f7f1bb3d065c44a796a1b959 +489 -0
- data/spec/dummy/tmp/dragonfly/cache/body/09/7fc6a9593ea7b3a9992dd166cdc87cf0e06afc +2341 -0
- data/spec/dummy/tmp/dragonfly/cache/body/09/c8b9529699d7f44fc6e314c992ea222ecf891a +926 -0
- data/spec/dummy/tmp/dragonfly/cache/body/0a/eae45805608cdebd81ace3ac272d43ef8c581a +517 -0
- data/spec/dummy/tmp/dragonfly/cache/body/0f/33cebc2562a1ba143494c74b572a7f569c398e +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/12/f3e9f5435e64b368b805b0f6e2e5b04763e0e9 +713 -0
- data/spec/dummy/tmp/dragonfly/cache/body/13/02bfc481015a6a0abeb3bd17a166b761ba8a47 +626 -0
- data/spec/dummy/tmp/dragonfly/cache/body/14/132bf3af2f923b66a62826ebe1dd001f0ba183 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/16/3001f75355d109f24b59f690f7ba71c2616261 +2343 -0
- data/spec/dummy/tmp/dragonfly/cache/body/16/7a17ea4c64e37f9f0aa5e773501ee5131bb2af +552 -0
- data/spec/dummy/tmp/dragonfly/cache/body/18/1ddbad5715e03f6bcaeb409ca55a8f1f1c2b76 +1000 -0
- data/spec/dummy/tmp/dragonfly/cache/body/18/dc1d281e1b27f8e29a5d3ea3192ee5ab92c8fe +1721 -0
- data/spec/dummy/tmp/dragonfly/cache/body/19/244efbcbf0ed096cc80addb39d1139782691e4 +701 -0
- data/spec/dummy/tmp/dragonfly/cache/body/1b/09d865c098ccb9e1bb1783281f8f18ab22f49c +1016 -0
- data/spec/dummy/tmp/dragonfly/cache/body/1b/5baeb3d8b21ebdd6d60357437ea9b4ddefa49a +537 -0
- data/spec/dummy/tmp/dragonfly/cache/body/1b/f3995977d56cd70d334227ffae3858fdb3e1d4 +1011 -0
- data/spec/dummy/tmp/dragonfly/cache/body/1c/8c49d20e2ca7ccea3c7124923f2d6ff715400c +538 -0
- data/spec/dummy/tmp/dragonfly/cache/body/1e/3ce5b58c37f23053d85f581ff49d15ad1a498a +674 -0
- data/spec/dummy/tmp/dragonfly/cache/body/1f/de9c96ae1b545cb125a43f6c81fe6f15851ac7 +546 -0
- data/spec/dummy/tmp/dragonfly/cache/body/20/5d43e6adae0bf766e830109660e59dfd97a776 +646 -0
- data/spec/dummy/tmp/dragonfly/cache/body/20/9dd05484ee6eca030ee50cf71b912a67089c79 +2339 -0
- data/spec/dummy/tmp/dragonfly/cache/body/21/bdc0c588b6d2ddbbcc9b76fe749c38f0ef2f41 +872 -0
- data/spec/dummy/tmp/dragonfly/cache/body/22/f0e133e63c81c43643026aa5cbb3712bfa929e +708 -0
- data/spec/dummy/tmp/dragonfly/cache/body/24/f7da13054199d224537d7530367474f292c85a +2359 -0
- data/spec/dummy/tmp/dragonfly/cache/body/27/0ac007b4441579233e425f3e7a36887eb4298e +986 -0
- data/spec/dummy/tmp/dragonfly/cache/body/28/c775213c7f72c870045887887893831bbb9083 +1006 -0
- data/spec/dummy/tmp/dragonfly/cache/body/2a/602d5bf47ce3c3e1fbd540f3659acdf8488b84 +2341 -0
- data/spec/dummy/tmp/dragonfly/cache/body/2c/79dceb2787a90f7da9a43673db8d1f1922a379 +641 -0
- data/spec/dummy/tmp/dragonfly/cache/body/2d/016dc3e8be00f46455041e5187159762a1a72b +535 -0
- data/spec/dummy/tmp/dragonfly/cache/body/2d/40a96b71b5c4be6ea5de082c5c468b923df113 +626 -0
- data/spec/dummy/tmp/dragonfly/cache/body/2f/2077afd991927df732811e002d532f34a62c86 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/30/7cdb90b26de71fedb1774d7b7fe630e77cf34f +1011 -0
- data/spec/dummy/tmp/dragonfly/cache/body/33/43ee3681542a52fec318884c34cdc6233aec90 +2359 -0
- data/spec/dummy/tmp/dragonfly/cache/body/34/d994dfa8a8a2cf1dddcfcb9d7d43839f798a66 +1007 -0
- data/spec/dummy/tmp/dragonfly/cache/body/36/1acb61b84bbb2e3b1fe7cb28e1ca0bb2ebc147 +1721 -0
- data/spec/dummy/tmp/dragonfly/cache/body/37/0de185ac6803197940a4aca2ee4cb6cd97aa25 +700 -0
- data/spec/dummy/tmp/dragonfly/cache/body/39/36d756ac37cbfd7995a8413c5b813623f8c1d6 +496 -0
- data/spec/dummy/tmp/dragonfly/cache/body/39/c79f94952d16de5de0ec59089d381ace6e386e +1029 -0
- data/spec/dummy/tmp/dragonfly/cache/body/3f/457b87cdc17162db48461cf72c87457ebe753b +1011 -0
- data/spec/dummy/tmp/dragonfly/cache/body/40/d745dd4044031ccd76b4f5a8ad46e3c16ea8c0 +915 -0
- data/spec/dummy/tmp/dragonfly/cache/body/43/1a5a2dc62c3b453378dad049c48fcf36928f53 +2342 -0
- data/spec/dummy/tmp/dragonfly/cache/body/43/abfe6e68d8603f92084533b5f94fb717bc2b02 +700 -0
- data/spec/dummy/tmp/dragonfly/cache/body/44/65e89dffc7531e6479a00711d7bf430c56754f +2359 -0
- data/spec/dummy/tmp/dragonfly/cache/body/47/1092abd16e44c60537ac674b871481ca6d108e +489 -0
- data/spec/dummy/tmp/dragonfly/cache/body/47/befec7e863f30488d1c9a72619411e3c311eea +552 -0
- data/spec/dummy/tmp/dragonfly/cache/body/48/4af0743c55ececa9e2b3477a666492914d5a25 +700 -0
- data/spec/dummy/tmp/dragonfly/cache/body/48/5935b1ceed38545d44989a5464049018f63ecd +926 -0
- data/spec/dummy/tmp/dragonfly/cache/body/4a/db06a6fda9b3fbe12beb6816390a4fd61e4491 +667 -0
- data/spec/dummy/tmp/dragonfly/cache/body/4b/088deec20739cb75b3d8e2ca591171b342026d +862 -0
- data/spec/dummy/tmp/dragonfly/cache/body/4b/ea67064045b150fdd661d9b25fe1c447df7570 +703 -0
- data/spec/dummy/tmp/dragonfly/cache/body/50/8888bca37caef9e8ecf9434f304d1ab2cc820a +538 -0
- data/spec/dummy/tmp/dragonfly/cache/body/54/862500a3c1ce6a605de340ded6051d9d6c96dc +880 -0
- data/spec/dummy/tmp/dragonfly/cache/body/55/a3a5731c805bf0c5deda35500598030e91caf7 +2358 -0
- data/spec/dummy/tmp/dragonfly/cache/body/56/50f6edaa5e2fe07797333404d13fe63360f72c +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/56/dfa139236a6fcecf0fdd13308a17d03666d223 +2361 -0
- data/spec/dummy/tmp/dragonfly/cache/body/58/d135dda5118408bf76a2b381ac0d482276ee97 +546 -0
- data/spec/dummy/tmp/dragonfly/cache/body/59/0b00b9579bdc8d199e42d68cc83ee72ba6036a +712 -0
- data/spec/dummy/tmp/dragonfly/cache/body/59/c6cdda1534cfeb69aed8a295fa36aa0b34d9ac +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/5c/c982746925609ae2ddd24d20e9f96247006dc3 +883 -0
- data/spec/dummy/tmp/dragonfly/cache/body/5f/033e3fda7f0149729cdeba2807ccad0ce6ea32 +1016 -0
- data/spec/dummy/tmp/dragonfly/cache/body/5f/95bdb3eb07339f50a73c3e2c38d619b2321902 +2361 -0
- data/spec/dummy/tmp/dragonfly/cache/body/60/92cdccc969bab02d35b702148409d59276ec8e +703 -0
- data/spec/dummy/tmp/dragonfly/cache/body/62/d3974c45b38586ded0f6adefcefeb4e25aea08 +2357 -0
- data/spec/dummy/tmp/dragonfly/cache/body/63/9cff6d42d49aaded2e3201d0b311fb0c4d5af5 +872 -0
- data/spec/dummy/tmp/dragonfly/cache/body/65/b3251b1348841946320cd8ac140a7a10a07de5 +894 -0
- data/spec/dummy/tmp/dragonfly/cache/body/66/59b5c1535bed3649f05f378f9a935a9369a14f +2341 -0
- data/spec/dummy/tmp/dragonfly/cache/body/67/8611d272ec29fc5cb7a63a709a12f47da63fbd +538 -0
- data/spec/dummy/tmp/dragonfly/cache/body/68/9bc64959e48ba446c2a48a48952d4e6e422bee +2334 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6a/0be367e94b672cef188ef8c3261ed63fa59e6d +701 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6a/1642bac93ee93e5ca10af933c39f6db9e15508 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6a/4558d01c325e63bfe9abe3df6b1255e51a20e6 +703 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6b/8df0f17fd3ce7a7e551e91f30909a847a2abee +734 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6b/90cf2c21e1934876d420d2524fe5216c5e7bf1 +551 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6d/d8a547a0125a1da2df83e6b2f4c36631a1bd2f +538 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6e/a8d288ea6931b9277121b209ac32959b717029 +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/6f/b27a907116ff2fa7a668b30d49b65885a09022 +1016 -0
- data/spec/dummy/tmp/dragonfly/cache/body/71/01bff740c639a7b8383a5e247ece9552656acb +708 -0
- data/spec/dummy/tmp/dragonfly/cache/body/73/7752ee519e2ee8c13b4c9165fb98c19a874843 +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/74/c9b1fca6f96048f555aed33ddb5c5240839f62 +793 -0
- data/spec/dummy/tmp/dragonfly/cache/body/75/01f0f946848c6b910634bed2a58e748dd0a4d2 +986 -0
- data/spec/dummy/tmp/dragonfly/cache/body/75/15881fe428cd4b04438de4e03ba3acc7cd789e +642 -0
- data/spec/dummy/tmp/dragonfly/cache/body/77/02b8ae247e83a86e819b150375bd2971911635 +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/79/0ba4208b6b095e78b15c6f2c4ef04b9e568fdf +976 -0
- data/spec/dummy/tmp/dragonfly/cache/body/7a/40b3b7e48d2fb4f8dc6b9ce3b2c6414cd3db4b +638 -0
- data/spec/dummy/tmp/dragonfly/cache/body/7a/44fbc7caa954feca99ae14cdd31700f3bc01ca +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/81/1412d99f15c17d9a52618013667ddc6acbb5e7 +560 -0
- data/spec/dummy/tmp/dragonfly/cache/body/82/bb0ce1f6b156348edb5d054b09681adbb1541c +638 -0
- data/spec/dummy/tmp/dragonfly/cache/body/82/f4aef50c7d0580ce3de59af781988f8c027e31 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/84/3bafbd4a01aaae5795b68c2a21561fd78e8bfb +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/84/61cb5340e22fb0e266e5276613f5b218b793c0 +774 -0
- data/spec/dummy/tmp/dragonfly/cache/body/87/452e47dc8c565d70543b6a8b3aeeeafef5ede6 +1008 -0
- data/spec/dummy/tmp/dragonfly/cache/body/8e/6921af9cd9a9aa0cb4a521be98d497ff7fdeaf +700 -0
- data/spec/dummy/tmp/dragonfly/cache/body/8e/d1fec3f23b9477057019f581847f7f8b2051c3 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/8f/e7d4976bf7e183cf4f6ab9409f8503351dad3c +709 -0
- data/spec/dummy/tmp/dragonfly/cache/body/90/1abfe79ed8fa57b0f367b8d6cc284742d74bd9 +703 -0
- data/spec/dummy/tmp/dragonfly/cache/body/93/fe1fa30d5fe0cb493dd11ea6eaee9201b50cd8 +712 -0
- data/spec/dummy/tmp/dragonfly/cache/body/94/7a175f9de08b84499763ba6cc25f6911ef315e +913 -0
- data/spec/dummy/tmp/dragonfly/cache/body/98/2828d5b0867095317a017415955ef31a50dbc5 +1014 -0
- data/spec/dummy/tmp/dragonfly/cache/body/98/f06faf5cfff9a92b4d99d400523e1f1551742e +1007 -0
- data/spec/dummy/tmp/dragonfly/cache/body/99/2dab09135d5fcbaa2c2b833a8284cb56be5c26 +1014 -0
- data/spec/dummy/tmp/dragonfly/cache/body/99/b545fe8ab3b930d8997fd75bb08feea0c9754d +915 -0
- data/spec/dummy/tmp/dragonfly/cache/body/9a/ff030c94bb0fbe5d9fbb8cf6865236cb7d74b2 +217 -0
- data/spec/dummy/tmp/dragonfly/cache/body/9f/8083640216ee29b9e8b4f10990f33d94aa352c +2360 -0
- data/spec/dummy/tmp/dragonfly/cache/body/9f/f4d177f296f259ff4ef3ddb38583daaf7c4dad +1011 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a0/13144afc0d13219dad65508b046b9e0693a22b +926 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a1/44a32dab1df021f54bf212d2a401b7fc69a2d8 +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a2/7996e882d74e2e2c590fbfee8a8842b43f5c5e +1014 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a2/e9ac7eba6c9ac611ec0cb7f26cbe0711b4b59c +694 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a3/cd2fc5aabd1c551bba7f290844b8d89c94ab1e +523 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a4/1a483a32348565e7afc810f49f55c1a9cbcd5d +707 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a5/ddf1a8e968d20390ab06c94b19eb69a1e81ad7 +908 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a6/f516919f720c81c119adadf1693ea44e5b90fe +490 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a8/5137398b4d62aacbb0921f50eb9f62e7ec8de4 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/a8/fb555a7e2420a17ce30758861ac3de784677eb +1011 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b0/9703b98c965449cfbff801b8482e5c2c9b1b50 +954 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b1/4c0f9e41101026eff8ebdc3fc9eae61c25372b +700 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b3/d870794114f8ce678eeeddb0616abbea93ec7b +562 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b4/1d331b6f64144bdee2ab598fd7f5ed2bcb6c3c +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b4/84edbbb2dae5a5fc1cbfc8c8d3517bd1466a1b +2359 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b5/52eaf4b5bac5fcf8667e5fb74f4b1c61984b0e +537 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b6/9ec86cf5018fe63297e409da6638450c5041d2 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b7/31c759f6bf5b6adc13874d8ccf325a1715bf33 +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b8/84c73fced17e1cb4f2efc18ed4f81789e5a622 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b9/43df43ad225c99d420cdb7e5d7714c2876273f +1007 -0
- data/spec/dummy/tmp/dragonfly/cache/body/b9/b4cb4d1647df4ec458ef3cc18782261a46bef2 +641 -0
- data/spec/dummy/tmp/dragonfly/cache/body/ba/1c57461ee48afadc870fca415b0e2aeaec3f4a +882 -0
- data/spec/dummy/tmp/dragonfly/cache/body/be/d14e3b72d93bfc0cace752edf21f5cc2af8949 +2358 -0
- data/spec/dummy/tmp/dragonfly/cache/body/c1/0767685a05c93f5e79a81ec5016820d7068afd +281 -0
- data/spec/dummy/tmp/dragonfly/cache/body/c3/5f95670b5171f06b0c450331c20ce59d44d5bd +537 -0
- data/spec/dummy/tmp/dragonfly/cache/body/c3/c76755904506b55cc288baed5e8f3ae767e1f9 +908 -0
- data/spec/dummy/tmp/dragonfly/cache/body/c7/48859071d0c1e701557a2b59181ae9d40b4c1c +1029 -0
- data/spec/dummy/tmp/dragonfly/cache/body/cc/e21614b70000b7a45bf382a696dfdf2e78811f +1029 -0
- data/spec/dummy/tmp/dragonfly/cache/body/cd/daa343d969732d44b9018e9e8403d758c1075b +2334 -0
- data/spec/dummy/tmp/dragonfly/cache/body/cd/dbba7b01cfb5eabf3c3b557d3cc1c7eeac9157 +523 -0
- data/spec/dummy/tmp/dragonfly/cache/body/d0/654133544a02cf512cdbe78256f913d684ee32 +894 -0
- data/spec/dummy/tmp/dragonfly/cache/body/d4/42ed09f48e3e24cd3cd958c9e0865df054419b +1029 -0
- data/spec/dummy/tmp/dragonfly/cache/body/d6/1eefad56108f5a8e1fa7aa72ff9b9f9cd633fc +538 -0
- data/spec/dummy/tmp/dragonfly/cache/body/d6/d1ac8848c469cd9094fa75b7528e0f5b6b632e +496 -0
- data/spec/dummy/tmp/dragonfly/cache/body/d7/899077450ebef4fdc0e9bb929825299f54457f +697 -0
- data/spec/dummy/tmp/dragonfly/cache/body/d9/f0d58e806b8697218740130d2ca12b3b86d6ef +1007 -0
- data/spec/dummy/tmp/dragonfly/cache/body/da/378953b0532aa6da1fa92abeeae89199ef8227 +1006 -0
- data/spec/dummy/tmp/dragonfly/cache/body/da/7c689c2f3a69f6770b63b71a8e71b6a1a28b37 +967 -0
- data/spec/dummy/tmp/dragonfly/cache/body/da/e26a3a67f1a9ea2332232ea28c90082c0e3bad +963 -0
- data/spec/dummy/tmp/dragonfly/cache/body/dc/abdd743fd3e9d7bd5647abeb86e66a3e6f9597 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/e0/85f72a9f92bfadac77ceb40b9dcce7f1d0c0b4 +712 -0
- data/spec/dummy/tmp/dragonfly/cache/body/e1/f71dadeca1e7e8044d7ffe33168a41cf4b915e +712 -0
- data/spec/dummy/tmp/dragonfly/cache/body/e3/5e3eeacd0fa04028277861a7e20aca055126bf +705 -0
- data/spec/dummy/tmp/dragonfly/cache/body/e7/71af29ca1fb912746c2a8c252ce2dbda293797 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/body/eb/d3df10f28dd5eb3361f2dea07bce8f31883cb4 +562 -0
- data/spec/dummy/tmp/dragonfly/cache/body/f2/0000c07c049d6b02b83c134a47f79d25c8f884 +1006 -0
- data/spec/dummy/tmp/dragonfly/cache/body/f3/81eaa388ae0115314da5ef3dff86dde481f6ea +1011 -0
- data/spec/dummy/tmp/dragonfly/cache/body/f4/f597679294dfce3758a1e23f8739ddadb7a07a +905 -0
- data/spec/dummy/tmp/dragonfly/cache/body/f6/5638ff81bbc2e264c25be9224311d5b88e199e +696 -0
- data/spec/dummy/tmp/dragonfly/cache/body/f8/4c49b7e7f1df8b9bf194c8e4f238965275a470 +638 -0
- data/spec/dummy/tmp/dragonfly/cache/body/f8/bce7bef222715dce37713e4b658bb432746046 +642 -0
- data/spec/dummy/tmp/dragonfly/cache/body/fb/4bbd9bd1b55ea5c5f029a98429cbe84fecbd56 +1029 -0
- data/spec/dummy/tmp/dragonfly/cache/body/fe/83a325403c35319d9539703bf8b707c48cbb81 +700 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/0b/a9c9bfcc4c3c931157c0740283f9879ffbc80e +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/16/82dfe14b1caadf556cccc78e6742ecba3c8f50 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/18/2807a34d96c2dc102f1c7f2c2fe2a3dea0152a +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/1b/df42876b5661f82d4041d818e787e2f58949e7 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/1d/f723c27427056dd58a506f1e4f15020442098e +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/22/66939b783406813e2f0a76f3a2f29473675994 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/23/4f7740cb6118c7c530ce379339a99828a75ef3 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/26/25fc31c2b02071c5c60621d36793dc55fdb33c +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/29/717968cc2fa016a4911e7161b6423235f36c87 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/2d/83e1c5e84c02b8fee05b62d483999bfaba7be0 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/2d/b7fe2b8774fa388daa3c8370f34052119b4222 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/2d/fe381b58b48b16278672bd61db736e4e920955 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/32/e0d3566d2be50daabce5a94c515f772050829b +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/38/5bb4a3ceace256ca114fc14a3c5ae12ec83fb0 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/39/b52b68255f54efe8cb853fd153088f94a7661a +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/3e/0173e72157b702c4926d190389540028b0ae1d +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/52/a111bad2ef8c87af7f55baf0ffc5cdefc446e4 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/55/32c60f25996b8e8a9fdf7125956c5204fa8792 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/64/61f1782e6f9ec4e6416c0aec429529ea70a1a1 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/66/b6e26427e56a9f9ade00d4cf5d615679f0f7a7 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/66/f44aba1428593600ff0e47ea6aa54362e39a59 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/6d/f4ba8735866613f9b640f6a0cc8e4583eba1f9 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/78/d74c0cd05a77c0c06acb622761d30c9ea00bb3 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/7a/6033b3a3f17fbddc765d138d39de24f94f0965 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/7a/d6666861b23fcf6c7ea45d61810fdb1c14d9d0 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/80/5841ac20acdd8dd41460c8346294abc5c4dd8f +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/83/5df7873207b08f78fd9d690e5a0b759242b937 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/83/696c30e03b7215b60e076bc528c8829ddcc516 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/83/b01df8c183f9586aff3f30bd22f4c24793c52b +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/85/289eb541e97e28d96dacfd07c314be3beb566a +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/8c/1a23bf2dd650d0327255a5fe948c325d350107 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/8f/5281faf3f227ef4bbbd3b644cc9eafc86ff9b1 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/91/0922a2bd8308a75961dac5733d4907df678f65 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/92/8e4f3f982b856114506c590c291dea7f0c29d7 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/92/99ecbc80a7e8abcc02a36d9c3365b23b1a5b1a +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/98/00e4dc8c2a89849e9d3cb8dd37f8c45d744dd3 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/9d/4531b3a9ffdee2c2b2b485675e8b055a2de25f +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/a2/5920380e48276ad6f8bc26fb9a4a527db839c8 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/b7/407b5584752ca5298158a78be896bf810dd4e0 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/b7/ae83f0c4d7b4849a78af8830c31ffe4b166b52 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/d2/458b4acc8a67ee57346f1f4ebfa0f0e4bb4ea3 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/d5/341018026448c1d4f56801bd7ddb8380e1a73c +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/e7/6d1dc2d45d19440e781f6c5d00f39d8aeb4da1 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/ee/fe74949a8c2a0bbc077385a12944d9f98a12e0 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/ef/d71b44567b90c7f85e9bd0576e4b7e55bd3565 +0 -0
- data/spec/dummy/tmp/dragonfly/cache/meta/f9/67ac04386c59253bd80f4034d18af166cc5691 +0 -0
- data/spec/dummy/tmp/sass-cache/6e61637ec8d1d247724328e8c4a6704fe36b468e/_hacks.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/77824dc1336af71703311a2e58b21a32c1511e63/_border-radius.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/77824dc1336af71703311a2e58b21a32c1511e63/_box-shadow.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/77824dc1336af71703311a2e58b21a32c1511e63/_gradient.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/77824dc1336af71703311a2e58b21a32c1511e63/_images.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/77824dc1336af71703311a2e58b21a32c1511e63/_inline-block.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/77824dc1336af71703311a2e58b21a32c1511e63/_shared.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/bc54e898614d486bf9338d646e8cd056915d4779/buttons.css.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/bc54e898614d486bf9338d646e8cd056915d4779/redactor.css.scssc +0 -0
- data/spec/dummy/tmp/sass-cache/d1a1c9c63df53223abb80676ef7dcc16c1375c54/_support.scssc +0 -0
- metadata +605 -20
- data/spec/dummy/tmp/pids/server.pid +0 -1
@@ -0,0 +1,1721 @@
|
|
1
|
+
// Define: Linkify plugin from stackoverflow
|
2
|
+
(function($){
|
3
|
+
var url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g;
|
4
|
+
|
5
|
+
linkifyThis = function ()
|
6
|
+
{
|
7
|
+
var childNodes = this.childNodes,
|
8
|
+
i = childNodes.length;
|
9
|
+
while(i--)
|
10
|
+
{
|
11
|
+
var n = childNodes[i];
|
12
|
+
if (n.nodeType == 3)
|
13
|
+
{
|
14
|
+
var html = n.nodeValue;
|
15
|
+
if (html)
|
16
|
+
{
|
17
|
+
html = html.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(url2, '$1<a href="$2">$2</a>$5');
|
18
|
+
$(n).after(html).remove();
|
19
|
+
}
|
20
|
+
}
|
21
|
+
else if (n.nodeType == 1 && !/^(a|button|textarea)$/i.test(n.tagName)) linkifyThis.call(n);
|
22
|
+
}
|
23
|
+
};
|
24
|
+
|
25
|
+
$.fn.linkify = function ()
|
26
|
+
{
|
27
|
+
this.each(linkifyThis);
|
28
|
+
};
|
29
|
+
|
30
|
+
})(jQuery);
|
31
|
+
/* jQuery plugin textselect
|
32
|
+
* version: 0.9
|
33
|
+
* author: Josef Moravec, josef.moravec@gmail.com
|
34
|
+
* updated: Imperavi
|
35
|
+
*
|
36
|
+
*/
|
37
|
+
|
38
|
+
(function($){$.event.special.textselect={setup:function(data,namespaces)
|
39
|
+
{$(this).data("textselected",false);$(this).data("ttt",data);$(this).bind('mouseup',$.event.special.textselect.handler);},teardown:function(data)
|
40
|
+
{$(this).unbind('mouseup',$.event.special.textselect.handler);},handler:function(event)
|
41
|
+
{var data=$(this).data("ttt");var text=$.event.special.textselect.getSelectedText(data).toString();if(text!='')
|
42
|
+
{$(this).data("textselected",true);event.type="textselect";event.text=text;$.event.handle.apply(this,arguments);}},getSelectedText:function(data)
|
43
|
+
{var text='';var frame=$('#imp_redactor_frame_'+data).get(0);if(frame.contentWindow.getSelection)text=frame.contentWindow.getSelection();else if(frame.contentWindow.document.getSelection) text=frame.contentWindow.document.getSelection();else if(frame.contentWindow.document.selection)text=frame.contentWindow.document.selection.createRange().text;return text;}}
|
44
|
+
$.event.special.textunselect={setup:function(data,namespaces){$(this).data("rttt",data);$(this).data("textselected",false);$(this).bind('mouseup',$.event.special.textunselect.handler);$(this).bind('keyup',$.event.special.textunselect.handlerKey)},teardown:function(data){$(this).unbind('mouseup',$.event.special.textunselect.handler);},handler:function(event){if($(this).data("textselected")){var data=$(this).data("rttt");var text=$.event.special.textselect.getSelectedText(data).toString();if(text==''){$(this).data("textselected",false);event.type="textunselect";$.event.handle.apply(this,arguments);}}},handlerKey:function(event){if($(this).data("textselected")){var data=$(this).data("rttt");var text=$.event.special.textselect.getSelectedText(data).toString();if((event.keyCode=27)&&(text=='')){$(this).data("textselected",false);event.type="textunselect";$.event.handle.apply(this,arguments);}}}}})(jQuery);
|
45
|
+
|
46
|
+
/*
|
47
|
+
Plugin Drag and drop Upload v1.0.0
|
48
|
+
http://imperavi.com/
|
49
|
+
Copyright 2011, Imperavi Ltd.
|
50
|
+
*/
|
51
|
+
|
52
|
+
(function($){
|
53
|
+
|
54
|
+
// Initialization
|
55
|
+
$.fn.dragupload = function(options)
|
56
|
+
{
|
57
|
+
return this.each(function() {
|
58
|
+
var obj = new Construct(this, options);
|
59
|
+
obj.init();
|
60
|
+
});
|
61
|
+
};
|
62
|
+
|
63
|
+
// Options and variables
|
64
|
+
function Construct(el, options) {
|
65
|
+
this.opts = $.extend({
|
66
|
+
url: false,
|
67
|
+
success: false,
|
68
|
+
maxfilesize: 10485760, // 10MB
|
69
|
+
preview: false,
|
70
|
+
text: RLANG.drop_file_here,
|
71
|
+
atext: RLANG.or_choose
|
72
|
+
}, options);
|
73
|
+
|
74
|
+
this.$el = $(el);
|
75
|
+
};
|
76
|
+
|
77
|
+
// Functionality
|
78
|
+
Construct.prototype = {
|
79
|
+
init: function()
|
80
|
+
{
|
81
|
+
if (!$.browser.opera && !$.browser.msie)
|
82
|
+
{
|
83
|
+
this.droparea = $('<div class="redactor_droparea"></div>');
|
84
|
+
this.dropareabox = $('<div class="redactor_dropareabox">' + this.opts.text + '</div>');
|
85
|
+
this.dropalternative = $('<div class="redactor_dropalternative">' + this.opts.atext + '</div>');
|
86
|
+
|
87
|
+
this.droparea.append(this.dropareabox);
|
88
|
+
|
89
|
+
this.$el.before(this.droparea);
|
90
|
+
this.$el.before(this.dropalternative);
|
91
|
+
|
92
|
+
|
93
|
+
// drag over
|
94
|
+
this.dropareabox.bind('dragover', function() { return this.ondrag(); }.bind2(this));
|
95
|
+
|
96
|
+
// drag leave
|
97
|
+
this.dropareabox.bind('dragleave', function() { return this.ondragleave(); }.bind2(this));
|
98
|
+
|
99
|
+
|
100
|
+
// drop
|
101
|
+
this.dropareabox.get(0).ondrop = function(event) {
|
102
|
+
event.preventDefault();
|
103
|
+
|
104
|
+
this.dropareabox.removeClass('hover').addClass('drop');
|
105
|
+
|
106
|
+
var file = event.dataTransfer.files[0];
|
107
|
+
var fd = new FormData();
|
108
|
+
|
109
|
+
fd.append('file', file);
|
110
|
+
|
111
|
+
$.ajax({
|
112
|
+
url: this.opts.url,
|
113
|
+
data: fd,
|
114
|
+
//xhr: provider,
|
115
|
+
cache: false,
|
116
|
+
contentType: false,
|
117
|
+
processData: false,
|
118
|
+
type: 'POST',
|
119
|
+
success: function(data)
|
120
|
+
{
|
121
|
+
if (this.opts.success !== false) this.opts.success(data);
|
122
|
+
|
123
|
+
if (this.opts.preview === true) this.dropareabox.html(data);
|
124
|
+
//else this.dropareabox.text(this.opts.success_text);
|
125
|
+
|
126
|
+
}.bind2(this)
|
127
|
+
});
|
128
|
+
|
129
|
+
|
130
|
+
}.bind2(this);
|
131
|
+
}
|
132
|
+
},
|
133
|
+
ondrag: function()
|
134
|
+
{
|
135
|
+
this.dropareabox.addClass('hover');
|
136
|
+
return false;
|
137
|
+
},
|
138
|
+
ondragleave: function()
|
139
|
+
{
|
140
|
+
this.dropareabox.removeClass('hover');
|
141
|
+
return false;
|
142
|
+
}
|
143
|
+
};
|
144
|
+
|
145
|
+
|
146
|
+
})(jQuery);
|
147
|
+
/*
|
148
|
+
Redactor v7.2.0
|
149
|
+
Updated 20.11.2011
|
150
|
+
|
151
|
+
In English http://imperavi.com/
|
152
|
+
In Russian http://imperavi.ru/
|
153
|
+
|
154
|
+
Copyright (c) 2009-2012, Imperavi Ltd.
|
155
|
+
Dual licensed under the MIT or GPL Version 2 licenses.
|
156
|
+
|
157
|
+
Usage: $('#content').redactor();
|
158
|
+
*/
|
159
|
+
|
160
|
+
|
161
|
+
var isCtrl = false;
|
162
|
+
var redactorActive = false;
|
163
|
+
|
164
|
+
var $table = false;
|
165
|
+
var $tbody = false;
|
166
|
+
var $thead = false;
|
167
|
+
var $current_tr = false;
|
168
|
+
var $current_td = false;
|
169
|
+
|
170
|
+
var deviceAndroid = "android";
|
171
|
+
var uagent = navigator.userAgent.toLowerCase();
|
172
|
+
|
173
|
+
// detect iOS and Android
|
174
|
+
function isiOS() {
|
175
|
+
return ((navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPod") != -1) || (navigator.platform.indexOf("iPad") != -1));
|
176
|
+
}
|
177
|
+
|
178
|
+
function detectAndroid() {
|
179
|
+
return uagent.search(deviceAndroid) > -1
|
180
|
+
}
|
181
|
+
|
182
|
+
function detectAndroidWebKit() {
|
183
|
+
if (detectAndroid()) {
|
184
|
+
return uagent.search('webkit') > -1
|
185
|
+
}
|
186
|
+
|
187
|
+
return false;
|
188
|
+
}
|
189
|
+
|
190
|
+
// redactor
|
191
|
+
(function($){
|
192
|
+
// Initialization
|
193
|
+
$.fn.redactor = function(options) {
|
194
|
+
if (isiOS() || detectAndroid() || detectAndroidWebKit()) return false;
|
195
|
+
var obj = new Construct(this, options);
|
196
|
+
obj.init();
|
197
|
+
return obj;
|
198
|
+
};
|
199
|
+
|
200
|
+
// Options and variables
|
201
|
+
function Construct(el, options) {
|
202
|
+
this.opts = $.extend({
|
203
|
+
air : false,
|
204
|
+
autosave : false, // false or url
|
205
|
+
interval : 20, // seconds
|
206
|
+
resize : true,
|
207
|
+
visual : true,
|
208
|
+
focus : false,
|
209
|
+
autoclear : true,
|
210
|
+
removeClasses : false,
|
211
|
+
removeStyles : true,
|
212
|
+
convertLinks : true,
|
213
|
+
autoformat : true,
|
214
|
+
clearOnInit : false,
|
215
|
+
overlay : true, // modal overlay
|
216
|
+
fileUploadCallback : false, // callback function
|
217
|
+
imageUploadCallback : false, // callback function
|
218
|
+
|
219
|
+
// Paths to various handlers
|
220
|
+
paths : {
|
221
|
+
// Editor css
|
222
|
+
stylesheets : ['/assets/imperavi-rails/imperavi/wym.css'],
|
223
|
+
|
224
|
+
// Toolbar
|
225
|
+
toolbar : '/imperavi/toolbar.js',
|
226
|
+
|
227
|
+
// Interface translations
|
228
|
+
language : '/imperavi/language.js',
|
229
|
+
|
230
|
+
// Typograf
|
231
|
+
typograf : '/imperavi/typograf',
|
232
|
+
|
233
|
+
// Dialogs
|
234
|
+
// TODO Add dialogs sizes
|
235
|
+
dialogs : {
|
236
|
+
file : '/imperavi/file?r',
|
237
|
+
fileEdit : '/imperavi/file_edit',
|
238
|
+
image : '/imperavi/image?r',
|
239
|
+
imageEdit : '/imperavi/image_edit',
|
240
|
+
link : '/imperavi/link',
|
241
|
+
table : '/imperavi/table',
|
242
|
+
video : '/imperavi/video'
|
243
|
+
},
|
244
|
+
|
245
|
+
// Images
|
246
|
+
images : {
|
247
|
+
upload : '/imperavi/images',
|
248
|
+
download : '/imperavi/images/777',
|
249
|
+
list : '/imperavi/images.json'
|
250
|
+
},
|
251
|
+
|
252
|
+
// Files
|
253
|
+
files : {
|
254
|
+
upload : '/imperavi/files',
|
255
|
+
download : '/imperavi/files/777', // /tests/file_download.php?file=
|
256
|
+
remove : '/imperavi/files/777' // /tests/file_delete.php?delete=
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}, options);
|
260
|
+
|
261
|
+
this.$el = $(el);
|
262
|
+
};
|
263
|
+
|
264
|
+
// Functionality
|
265
|
+
Construct.prototype = {
|
266
|
+
init: function() {
|
267
|
+
if (this.opts.air) this.opts.toolbar = 'air';
|
268
|
+
|
269
|
+
// include lang and toolbar
|
270
|
+
this.include();
|
271
|
+
|
272
|
+
// sizes and id
|
273
|
+
this.frameID = this.$el.attr('id');
|
274
|
+
this.width = this.$el.css('width');
|
275
|
+
this.height = this.$el.css('height');
|
276
|
+
|
277
|
+
// modal overlay
|
278
|
+
if ($('#redactor_imp_modal_overlay').size() == 0) {
|
279
|
+
this.overlay = $('<div id="redactor_imp_modal_overlay" style="display: none;"></div>');
|
280
|
+
$('body').prepend(this.overlay);
|
281
|
+
}
|
282
|
+
|
283
|
+
// create container
|
284
|
+
this.box = $('<div id="imp_redactor_box_' + this.frameID + '" style="width: ' + this.width + ';" class="imp_redactor_box imp_redactor_box"></div>');
|
285
|
+
|
286
|
+
// air box
|
287
|
+
if (this.opts.air) {
|
288
|
+
this.air = $('<div id="imp_redactor_air_' + this.frameID + '" class="redactor_air" style="display: none;"></div>');
|
289
|
+
}
|
290
|
+
|
291
|
+
// create iframe
|
292
|
+
this.frame = $('<iframe frameborder="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" scrolling="auto" id="imp_redactor_frame_' + this.frameID + '" style="height: ' + this.height + ';" class="imp_redactor_frame"></iframe>');
|
293
|
+
|
294
|
+
this.$el.hide();
|
295
|
+
|
296
|
+
// append box and frame
|
297
|
+
$(this.box).insertAfter(this.$el).append(this.frame).append(this.$el);
|
298
|
+
|
299
|
+
// toolbar
|
300
|
+
if (this.opts.toolbar !== false) this.buildToolbar();
|
301
|
+
|
302
|
+
// resizer
|
303
|
+
if (this.opts.resize) {
|
304
|
+
this.resizer = $('<div id="imp_redactor_resize' + this.frameID + '" class="imp_redactor_resize"><div></div></div>');
|
305
|
+
$(this.box).append(this.resizer);
|
306
|
+
|
307
|
+
$(this.resizer).mousedown(function(e) { this.initResize(e) }.bind2(this));
|
308
|
+
}
|
309
|
+
|
310
|
+
// enable
|
311
|
+
this.enable(this.$el.val());
|
312
|
+
|
313
|
+
$(this.doc).click(function() { this.hideAllDropDown() }.bind2(this));
|
314
|
+
|
315
|
+
if (this.opts.autoclear) {
|
316
|
+
$(this.doc).bind('paste', function(e) {
|
317
|
+
setTimeout(function () { this.clean(); }.bind2(this), 200);
|
318
|
+
}.bind2(this));
|
319
|
+
}
|
320
|
+
|
321
|
+
// air enable
|
322
|
+
this.enableAir();
|
323
|
+
|
324
|
+
// doc events
|
325
|
+
$(this.doc).keydown(function(e) {
|
326
|
+
if (e.ctrlKey || e.metaKey) isCtrl = true;
|
327
|
+
if (e.keyCode == 9) { this.execCommand('indent', false); return false; }
|
328
|
+
if (e.keyCode == 66 && isCtrl) { this.execCommand('bold', 'bold'); return false; }
|
329
|
+
if (e.keyCode == 73 && isCtrl) { this.execCommand('italic', 'italic'); return false; }
|
330
|
+
|
331
|
+
}.bind2(this)).keyup(function(e) {
|
332
|
+
isCtrl = false;
|
333
|
+
|
334
|
+
if (e.keyCode == 13) {
|
335
|
+
$(this.doc).linkify();
|
336
|
+
return true;
|
337
|
+
}
|
338
|
+
|
339
|
+
this.syncCode();
|
340
|
+
}.bind2(this));
|
341
|
+
|
342
|
+
// autosave
|
343
|
+
if (this.opts.autosave) {
|
344
|
+
setInterval(function() {
|
345
|
+
var html = this.getHtml();
|
346
|
+
$.post(this.opts.autosave, { data: html });
|
347
|
+
}.bind2(this), this.opts.interval*1000);
|
348
|
+
}
|
349
|
+
|
350
|
+
this.formSets();
|
351
|
+
|
352
|
+
// focus
|
353
|
+
if (this.opts.focus) this.focus();
|
354
|
+
},
|
355
|
+
|
356
|
+
/*
|
357
|
+
API
|
358
|
+
*/
|
359
|
+
setHtml: function(html) {
|
360
|
+
this.doc.body.innerHTML = html;
|
361
|
+
this.docObserve();
|
362
|
+
},
|
363
|
+
|
364
|
+
getHtml: function() {
|
365
|
+
return this.doc.body.innerHTML;
|
366
|
+
},
|
367
|
+
|
368
|
+
getCode: function(clear) {
|
369
|
+
return this.$el.val();
|
370
|
+
},
|
371
|
+
|
372
|
+
focus: function() {
|
373
|
+
if ($.browser.msie) $(this.frame).load(function() { $(this).get(0).contentWindow.focus(); });
|
374
|
+
else this.frame.get(0).contentWindow.focus();
|
375
|
+
},
|
376
|
+
|
377
|
+
typo: function() {
|
378
|
+
var html = this.getHtml();
|
379
|
+
|
380
|
+
$.ajax({
|
381
|
+
url : this.opts.paths.typograf,
|
382
|
+
type : 'post',
|
383
|
+
data : 'redactor=' + escape(encodeURIComponent(html)),
|
384
|
+
success: function(data) {
|
385
|
+
this.setHtml(data);
|
386
|
+
}.bind2(this)
|
387
|
+
});
|
388
|
+
},
|
389
|
+
|
390
|
+
syncCode: function() {
|
391
|
+
var html = this.getHtml();
|
392
|
+
|
393
|
+
html = this.tidyUp(html);
|
394
|
+
html = html.replace(/\%7B/gi, '{');
|
395
|
+
html = html.replace(/\%7D/gi, '}');
|
396
|
+
html = html.replace(/<hr class="redactor_cut">/gi, '<!--more-->');
|
397
|
+
html = html.replace(/<hr class=redactor_cut>/gi, '<!--more-->');
|
398
|
+
this.$el.val(html);
|
399
|
+
},
|
400
|
+
|
401
|
+
destroy: function() {
|
402
|
+
var html = this.getCode();
|
403
|
+
$(this.box).after(this.$el)
|
404
|
+
this.box.remove();
|
405
|
+
this.$el.val(html).show();
|
406
|
+
},
|
407
|
+
|
408
|
+
// Include
|
409
|
+
include: function() {
|
410
|
+
// lang
|
411
|
+
$('head').append(
|
412
|
+
$('<script src="' + this.opts.paths.language + '"></script>')
|
413
|
+
);
|
414
|
+
|
415
|
+
// toolbar
|
416
|
+
// @tanraya
|
417
|
+
if (this.opts.toolbar !== false) {
|
418
|
+
$('head').append($('<script src="' + this.opts.paths.toolbar + '"></script>'));
|
419
|
+
}
|
420
|
+
},
|
421
|
+
|
422
|
+
// Enable
|
423
|
+
enable: function(html) {
|
424
|
+
this.doc = this.contentDocumentFrame(this.frame);
|
425
|
+
|
426
|
+
// flash replace
|
427
|
+
html = html.replace(/\<object([\w\W]*?)\<\/object\>/gi, '<p class="redactor_video_box"><object$1</object></p>');
|
428
|
+
|
429
|
+
if (html == '') {
|
430
|
+
if (this.opts.autoformat === true) {
|
431
|
+
html = $.browser.msie ? "<p></p>" : "<p> </p>";
|
432
|
+
}
|
433
|
+
}
|
434
|
+
|
435
|
+
this.redactorWrite(this.getRedactorDoc(html));
|
436
|
+
if (this.opts.clearOnInit) this.clean();
|
437
|
+
this.designMode();
|
438
|
+
},
|
439
|
+
|
440
|
+
enableAir: function() {
|
441
|
+
if (this.opts.air) {
|
442
|
+
$('#imp_redactor_air_' + this.frameID).hide();
|
443
|
+
|
444
|
+
$(this.doc).bind('textselect', this.frameID, function(e) {
|
445
|
+
var width = $('#imp_redactor_air_' + this.frameID).width();
|
446
|
+
var width_area = $(this.frame).width();
|
447
|
+
var diff = width_area - e.clientX;
|
448
|
+
|
449
|
+
if (diff < width) e.clientX = e.clientX - width;
|
450
|
+
|
451
|
+
$('#imp_redactor_air_' + this.frameID).css({ left: e.clientX + 'px', top: (e.clientY + 8) + 'px' }).show();
|
452
|
+
|
453
|
+
}.bind2(this));
|
454
|
+
|
455
|
+
$(this.doc).bind('textunselect', this.frameID, function() {
|
456
|
+
$('#imp_redactor_air_' + this.frameID).hide();
|
457
|
+
}.bind2(this));
|
458
|
+
}
|
459
|
+
},
|
460
|
+
|
461
|
+
redactorWrite: function(html) {
|
462
|
+
this.doc.open();
|
463
|
+
this.doc.write(html);
|
464
|
+
this.doc.close();
|
465
|
+
},
|
466
|
+
|
467
|
+
getRedactorDoc: function(html) {
|
468
|
+
css = '';
|
469
|
+
|
470
|
+
for (stylesheet in this.opts.paths.stylesheets) {
|
471
|
+
css += '<link media="all" href="' + this.opts.paths.stylesheets[stylesheet] + '" rel="stylesheet">';
|
472
|
+
}
|
473
|
+
|
474
|
+
var frameHtml = '<!DOCTYPE html>\n';
|
475
|
+
frameHtml += '<html><head>' + css + '</head><body>';
|
476
|
+
frameHtml += html;
|
477
|
+
frameHtml += '</body></html>';
|
478
|
+
|
479
|
+
return frameHtml;
|
480
|
+
},
|
481
|
+
|
482
|
+
contentDocumentFrame: function(frame) {
|
483
|
+
frame = frame.get(0);
|
484
|
+
|
485
|
+
if (frame.contentDocument) return frame.contentDocument;
|
486
|
+
else if (frame.contentWindow && frame.contentWindow.document) return frame.contentWindow.document;
|
487
|
+
else if (frame.document) return frame.document;
|
488
|
+
else return null;
|
489
|
+
},
|
490
|
+
|
491
|
+
designMode: function() {
|
492
|
+
if (this.doc) {
|
493
|
+
this.doc.designMode = 'on';
|
494
|
+
this.frame.load(function() {
|
495
|
+
this.enableObjects();
|
496
|
+
this.docObserve();
|
497
|
+
this.doc.designMode = 'on';
|
498
|
+
}.bind2(this));
|
499
|
+
}
|
500
|
+
},
|
501
|
+
|
502
|
+
enableObjects: function() {
|
503
|
+
if ($.browser.mozilla) {
|
504
|
+
this.doc.execCommand("enableObjectResizing", false, "false");
|
505
|
+
this.doc.execCommand("enableInlineTableEditing", false, "false");
|
506
|
+
}
|
507
|
+
},
|
508
|
+
|
509
|
+
|
510
|
+
// Observers
|
511
|
+
docObserve: function() {
|
512
|
+
var body = $(this.doc).find('body');
|
513
|
+
|
514
|
+
body.find('img').click(function(e) { this.imageEdit(e); }.bind2(this));
|
515
|
+
body.find('table').click(function(e) { this.tableObserver(e); }.bind2(this));
|
516
|
+
body.find('.redactor_file_link').click(function(e) { this.fileEdit(e); }.bind2(this));
|
517
|
+
|
518
|
+
},
|
519
|
+
|
520
|
+
// Format on submit form
|
521
|
+
formSets: function() {
|
522
|
+
var oldOnsubmit = null;
|
523
|
+
var theForm = $(this.box).parents('form');
|
524
|
+
|
525
|
+
if (theForm.length == 0) return false;
|
526
|
+
|
527
|
+
oldOnsubmit = theForm.get(0).onsubmit;
|
528
|
+
|
529
|
+
if (typeof theForm.get(0).onsubmit != "function") {
|
530
|
+
theForm.get(0).onsubmit = function() {
|
531
|
+
if (this.opts.visual) {
|
532
|
+
this.syncCode();
|
533
|
+
return true;
|
534
|
+
}
|
535
|
+
}.bind2(this)
|
536
|
+
} else {
|
537
|
+
theForm.get(0).onsubmit = function() {
|
538
|
+
if (this.opts.visual) {
|
539
|
+
this.syncCode();
|
540
|
+
return oldOnsubmit();
|
541
|
+
}
|
542
|
+
}.bind2(this)
|
543
|
+
}
|
544
|
+
|
545
|
+
return true;
|
546
|
+
},
|
547
|
+
|
548
|
+
// Exec
|
549
|
+
execCommand: function(cmd, param) {
|
550
|
+
if (this.opts.visual && this.doc) {
|
551
|
+
try {
|
552
|
+
this.frame.get(0).contentWindow.focus();
|
553
|
+
|
554
|
+
if (cmd == 'inserthtml' && $.browser.msie) {
|
555
|
+
this.doc.selection.createRange().pasteHTML(param);
|
556
|
+
} else {
|
557
|
+
this.doc.execCommand(cmd, false, param);
|
558
|
+
|
559
|
+
if (param == "blockquote" || param == 'pre')
|
560
|
+
this.doc.body.appendChild(this.doc.createElement("BR"));
|
561
|
+
}
|
562
|
+
} catch (e) { }
|
563
|
+
|
564
|
+
this.syncCode();
|
565
|
+
if (this.opts.air) $('#imp_redactor_air_' + this.frameID).hide();
|
566
|
+
}
|
567
|
+
},
|
568
|
+
|
569
|
+
// Format and clean
|
570
|
+
clean: function() {
|
571
|
+
var html = this.getHtml();
|
572
|
+
|
573
|
+
if ($.browser.mozilla) html = this.convertSpan(html);
|
574
|
+
|
575
|
+
// strip tags
|
576
|
+
html = html.replace(/<(?!\s*\/?(a|br|p|b|i|strong|em|table|tr|td|th|tbody|thead|tfoot|h2|h3|h4)\b)[^>]+>/ig,"");
|
577
|
+
|
578
|
+
if (this.opts.removeStyles) html = html.replace(/ style=".*?"/g, '');
|
579
|
+
if (this.opts.removeClasses) html = html.replace(/ class=".*?"/g, '');
|
580
|
+
|
581
|
+
html = this.tidyUp(html);
|
582
|
+
|
583
|
+
this.setHtml(html);
|
584
|
+
this.paragraphise();
|
585
|
+
|
586
|
+
return html;
|
587
|
+
},
|
588
|
+
|
589
|
+
tidyUp: function (html) {
|
590
|
+
// lowercase
|
591
|
+
if ($.browser.msie)
|
592
|
+
{
|
593
|
+
html = html.replace(/< *(\/ *)?(\w+)/g,function(w){return w.toLowerCase()});
|
594
|
+
html = html.replace(/ jQuery(.*?)=\"(.*?)\"/gi, '');
|
595
|
+
}
|
596
|
+
|
597
|
+
if (this.opts.convertLinks) html = this.convertLinks(html);
|
598
|
+
|
599
|
+
html = html.replace(/[\t]*/g, '');
|
600
|
+
html = html.replace(/[\r\n]*/g, '');
|
601
|
+
html = html.replace(/\n\s*\n/g, "\n");
|
602
|
+
html = html.replace(/^[\s\n]*/, '');
|
603
|
+
html = html.replace(/[\s\n]*$/, '');
|
604
|
+
|
605
|
+
var lb = '\r\n';
|
606
|
+
var btags = ["<html","</html>","</head>","<title","</title>","<meta","<link","<style","</style>","</body>","<body","<head","<div","<p","<form","<fieldset","<label","</label>","<legend","</legend>","<object","</object>","<embed","</embed>","<select","</select>","<option","<option","<input","<textarea","</textarea>","</form>","</fieldset>","<br>","<br />","<hr","<pre","</pre>","<blockquote","</blockquote>","<ul","</ul>","<ol","</ol>","<li","<dl","</dl>","<dt","</dt>","<dd","</dd>","<\!--","<table","</table>","</thead>","<tbody","</tbody>","<caption","</caption>","<th","</th>","<tr","</tr>","<td","<script","</script>","<noscript","</noscript>"];
|
607
|
+
for (i = 0; i < btags.length; ++i)
|
608
|
+
{
|
609
|
+
var bbb = btags[i];
|
610
|
+
html = html.replace(new RegExp(bbb,'gi'),lb+bbb);
|
611
|
+
}
|
612
|
+
|
613
|
+
// indenting
|
614
|
+
html = html.replace(/<li/g, "\t<li");
|
615
|
+
html = html.replace(/<tr/g, "\t<tr");
|
616
|
+
html = html.replace(/<td/g, "\t\t<td");
|
617
|
+
html = html.replace(/<\/tr>/g, "\t</tr>");
|
618
|
+
|
619
|
+
// empty tags
|
620
|
+
var btags = ["<pre></pre>","<blockquote></blockquote>","<ul></ul>","<ol></ol>","<li></li>","<table></table>","<tr></tr>","<span><span>", "<p> </p>", "<p></p>", "<p><br></p>", "<div></div>"];
|
621
|
+
for (i = 0; i < btags.length; ++i)
|
622
|
+
{
|
623
|
+
var bbb = btags[i];
|
624
|
+
html = html.replace(new RegExp(bbb,'gi'), "");
|
625
|
+
}
|
626
|
+
|
627
|
+
return html;
|
628
|
+
},
|
629
|
+
|
630
|
+
convertLinks: function(html)
|
631
|
+
{
|
632
|
+
html = html.replace(/\<a(.*?)href="http:\/\/(.*?)"(.*?)>([\w\W]*?)\<\/a\>/gi, "<a$1href=\"rttp://$2\"$3>$4</a>");
|
633
|
+
html = html.replace(/\<a(.*?)href="rttp:\/\/(.*?)"(.*?)>http:\/\/([\w\W]*?)\<\/a\>/gi, "<a$1href=\"rttp://$2\"$3>rttp:\/\/$4</a>");
|
634
|
+
|
635
|
+
//var url1 = /(^|>|\s)(www\..+?\..+?)(\s|<|$)/g;
|
636
|
+
var url2 = /(^|>|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|<|$)/g;
|
637
|
+
|
638
|
+
//html = html.replace(url1, '$1<a href="http://$2">$2</a>$3')
|
639
|
+
html = html.replace(url2, '$1<a href="$2">$2</a>$5');
|
640
|
+
|
641
|
+
html = html.replace(/\<a(.*?)href="rttp:\/\/(.*?)"(.*?)>([\w\W]*?)\<\/a\>/gi, "<a$1href=\"http://$2\"$3>$4</a>");
|
642
|
+
html = html.replace(/\<a(.*?)href="http:\/\/(.*?)"(.*?)>rttp:\/\/([\w\W]*?)\<\/a\>/gi, "<a$1href=\"http://$2\"$3>http://$4</a>");
|
643
|
+
|
644
|
+
return html;
|
645
|
+
},
|
646
|
+
|
647
|
+
convertSpan: function(html)
|
648
|
+
{
|
649
|
+
html = html.replace(/\<span(.*?)style="font-weight: bold;"\>([\w\W]*?)\<\/span\>/gi, "<strong>$2</strong>");
|
650
|
+
html = html.replace(/\<span(.*?)style="font-style: italic;"\>([\w\W]*?)\<\/span\>/gi, "<em>$2</em>");
|
651
|
+
html = html.replace(/\<span(.*?)style="font-weight: bold; font-style: italic;"\>([\w\W]*?)\<\/span\>/gi, "<em><strong>$2</strong></em>");
|
652
|
+
html = html.replace(/\<span(.*?)style="font-style: italic; font-weight: bold;"\>([\w\W]*?)\<\/span\>/gi, "<strong><em>$2</em></strong>");
|
653
|
+
|
654
|
+
return html;
|
655
|
+
},
|
656
|
+
|
657
|
+
/*
|
658
|
+
Paragraphise
|
659
|
+
*/
|
660
|
+
paragraphise: function()
|
661
|
+
{
|
662
|
+
|
663
|
+
if (this.opts.autoformat === false) return true;
|
664
|
+
if (this.opts.visual)
|
665
|
+
{
|
666
|
+
var theBody = this.doc.body;
|
667
|
+
|
668
|
+
/* Remove all text nodes containing just whitespace */
|
669
|
+
for (var i = 0; i < theBody.childNodes.length; i++)
|
670
|
+
{
|
671
|
+
if (theBody.childNodes[i].nodeName.toLowerCase() == "#text" && theBody.childNodes[i].data.search(/^\s*$/) != -1)
|
672
|
+
{
|
673
|
+
theBody.removeChild(theBody.childNodes[i]);
|
674
|
+
i--;
|
675
|
+
}
|
676
|
+
}
|
677
|
+
|
678
|
+
var removedElements = new Array();
|
679
|
+
for (var i = 0; i < theBody.childNodes.length; i++)
|
680
|
+
{
|
681
|
+
if (theBody.childNodes[i].nodeName.isInlineName())
|
682
|
+
{
|
683
|
+
removedElements.push(theBody.childNodes[i].cloneNode(true));
|
684
|
+
theBody.removeChild(theBody.childNodes[i]);
|
685
|
+
i--;
|
686
|
+
}
|
687
|
+
else if (theBody.childNodes[i].nodeName.toLowerCase() == "br")
|
688
|
+
{
|
689
|
+
if (i + 1 < theBody.childNodes.length)
|
690
|
+
{
|
691
|
+
if (theBody.childNodes[i + 1].nodeName.toLowerCase() == "br")
|
692
|
+
{
|
693
|
+
while (i < theBody.childNodes.length && theBody.childNodes[i].nodeName.toLowerCase() == "br")
|
694
|
+
{
|
695
|
+
theBody.removeChild(theBody.childNodes[i]);
|
696
|
+
}
|
697
|
+
|
698
|
+
if (removedElements.length > 0)
|
699
|
+
{
|
700
|
+
this.insertNewParagraph(removedElements, theBody.childNodes[i]);
|
701
|
+
removedElements = new Array();
|
702
|
+
}
|
703
|
+
}
|
704
|
+
else if (!theBody.childNodes[i + 1].nodeName.isInlineName()) theBody.removeChild(theBody.childNodes[i]);
|
705
|
+
else if (removedElements.length > 0)
|
706
|
+
{
|
707
|
+
removedElements.push(theBody.childNodes[i].cloneNode(true));
|
708
|
+
theBody.removeChild(theBody.childNodes[i]);
|
709
|
+
}
|
710
|
+
else theBody.removeChild(theBody.childNodes[i]);
|
711
|
+
i--;
|
712
|
+
}
|
713
|
+
else theBody.removeChild(theBody.childNodes[i]);
|
714
|
+
}
|
715
|
+
else if (removedElements.length > 0)
|
716
|
+
{
|
717
|
+
this.insertNewParagraph(removedElements, theBody.childNodes[i]);
|
718
|
+
removedElements = new Array();
|
719
|
+
}
|
720
|
+
}
|
721
|
+
|
722
|
+
if (removedElements.length > 0) this.insertNewParagraph(removedElements);
|
723
|
+
}
|
724
|
+
|
725
|
+
return true;
|
726
|
+
},
|
727
|
+
insertNewParagraph: function(elementArray, succeedingElement)
|
728
|
+
{
|
729
|
+
var theBody = this.doc.getElementsByTagName("body")[0];
|
730
|
+
var theParagraph = this.doc.createElement("p");
|
731
|
+
|
732
|
+
for (var i = 0; i < elementArray.length; i++) theParagraph.appendChild(elementArray[i]);
|
733
|
+
|
734
|
+
if (typeof(succeedingElement) != "undefined") theBody.insertBefore(theParagraph, succeedingElement);
|
735
|
+
else theBody.appendChild(theParagraph);
|
736
|
+
|
737
|
+
return true;
|
738
|
+
},
|
739
|
+
|
740
|
+
/*
|
741
|
+
Selection
|
742
|
+
*/
|
743
|
+
get_selection: function ()
|
744
|
+
{
|
745
|
+
if (this.frame.get(0).contentWindow.getSelection) return this.frame.get(0).contentWindow.getSelection();
|
746
|
+
else if (this.frame.get(0).contentWindow.document.selection) return this.frame.contentWindow.get(0).document.selection.createRange();
|
747
|
+
},
|
748
|
+
|
749
|
+
setCut: function()
|
750
|
+
{
|
751
|
+
this.execCommand('inserthtml', '<hr class="redactor_cut" />');
|
752
|
+
},
|
753
|
+
|
754
|
+
/*
|
755
|
+
Toggle
|
756
|
+
*/
|
757
|
+
toggle: function()
|
758
|
+
{
|
759
|
+
if (this.opts.visual)
|
760
|
+
{
|
761
|
+
this.addSelButton('html');
|
762
|
+
|
763
|
+
var html = this.getHtml();
|
764
|
+
|
765
|
+
html = this.tidyUp(html);
|
766
|
+
|
767
|
+
html = html.replace(/\%7B/gi, '{');
|
768
|
+
html = html.replace(/\%7D/gi, '}');
|
769
|
+
|
770
|
+
// flash replace
|
771
|
+
html = html.replace(/<p(.*?)class="redactor_video_box"(.*?)>([\w\W]*?)\<\/p>/gi, "$3");
|
772
|
+
|
773
|
+
// files replace
|
774
|
+
html = html.replace(/<a(.*?)rel="(.*?)"(.*?)class="redactor_file_link(.*?)"(.*?)>([\w\W]*?)\<\/a>/gi, "<a href=\"" + this.opts.paths.files.download + "$2\" rel=\"$2\" class=\"redactor_file_link$4\">$6</a>");
|
775
|
+
|
776
|
+
// cut replace
|
777
|
+
html = html.replace(/<hr class="redactor_cut"\/>/gi, '<!--more-->');
|
778
|
+
html = html.replace(/<hr class=redactor_cut>/gi, '<!--more-->');
|
779
|
+
|
780
|
+
|
781
|
+
this.frame.hide();
|
782
|
+
this.$el.val(html);
|
783
|
+
this.$el.show().focus();
|
784
|
+
|
785
|
+
var height = this.$el.height();
|
786
|
+
|
787
|
+
this.opts.visual = false;
|
788
|
+
}
|
789
|
+
else
|
790
|
+
{
|
791
|
+
this.removeSelButton('html');
|
792
|
+
this.$el.hide();
|
793
|
+
|
794
|
+
var html = this.$el.val();
|
795
|
+
|
796
|
+
// cut replace
|
797
|
+
html = html.replace(/<!--more-->/gi, '<hr class="redactor_cut"/>');
|
798
|
+
|
799
|
+
// flash replace
|
800
|
+
html = html.replace(/\<object([\w\W]*?)\<\/object\>/gi, '<p class="redactor_video_box"><object$1</object></p>');
|
801
|
+
|
802
|
+
// files replace
|
803
|
+
html = html.replace(/<a(.*?)href="(.*?)"(.*?)rel="(.*?)"(.*?)class="redactor_file_link(.*?)">(.*?)<\/a>/gi, "<a href=\"javascript:void(null);\" rel=\"$4\" class=\"redactor_file_link$6\">$7</a>");
|
804
|
+
|
805
|
+
|
806
|
+
this.opts.visual = true;
|
807
|
+
|
808
|
+
this.setHtml(html);
|
809
|
+
|
810
|
+
this.frame.show();
|
811
|
+
this.focus();
|
812
|
+
}
|
813
|
+
},
|
814
|
+
|
815
|
+
|
816
|
+
/*
|
817
|
+
Video
|
818
|
+
*/
|
819
|
+
showVideo: function()
|
820
|
+
{
|
821
|
+
redactorActive = this;
|
822
|
+
this.modalInit(RLANG.video, this.opts.paths.dialogs.video, 600, 360, function()
|
823
|
+
{
|
824
|
+
$('#redactor_insert_video_area').focus();
|
825
|
+
});
|
826
|
+
},
|
827
|
+
insertVideo: function()
|
828
|
+
{
|
829
|
+
var data = $('#redactor_insert_video_area').val();
|
830
|
+
if (redactorActive.opts.visual)
|
831
|
+
{
|
832
|
+
// iframe video
|
833
|
+
if (data.search('iframe')) {}
|
834
|
+
// flash
|
835
|
+
else data = '<p class="redactor_video_box">' + data + '</p>';
|
836
|
+
}
|
837
|
+
|
838
|
+
redactorActive.execCommand('inserthtml', data);
|
839
|
+
this.modalClose();
|
840
|
+
|
841
|
+
},
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
/*
|
846
|
+
File
|
847
|
+
*/
|
848
|
+
showFile: function()
|
849
|
+
{
|
850
|
+
redactorActive = this;
|
851
|
+
|
852
|
+
var handler = function()
|
853
|
+
{
|
854
|
+
// upload params
|
855
|
+
var params = '';
|
856
|
+
if (this.opts.fileUploadCallback) params = this.opts.fileUploadCallback();
|
857
|
+
|
858
|
+
$('#redactor_file').dragupload(
|
859
|
+
{
|
860
|
+
url: this.opts.paths.files.upload + params,
|
861
|
+
success: function(data)
|
862
|
+
{
|
863
|
+
this.fileUploadCallback(data);
|
864
|
+
|
865
|
+
}.bind2(this)
|
866
|
+
});
|
867
|
+
|
868
|
+
this.uploadInit('redactor_file', { auto: true, url: this.opts.paths.files.upload + params, success: function(data) {
|
869
|
+
|
870
|
+
this.fileUploadCallback(data);
|
871
|
+
|
872
|
+
}.bind2(this) });
|
873
|
+
|
874
|
+
|
875
|
+
}.bind2(this);
|
876
|
+
|
877
|
+
|
878
|
+
redactorActive = this;
|
879
|
+
this.modalInit(RLANG.file, this.opts.paths.dialogs.file, 500, 400, handler);
|
880
|
+
},
|
881
|
+
fileUploadCallback: function(data)
|
882
|
+
{
|
883
|
+
redactorActive.frame.get(0).contentWindow.focus();
|
884
|
+
redactorActive.execCommand('inserthtml', data);
|
885
|
+
this.modalClose();
|
886
|
+
this.docObserve();
|
887
|
+
},
|
888
|
+
fileEdit: function(e)
|
889
|
+
{
|
890
|
+
var el = e.target;
|
891
|
+
var file_id = $(el).attr('rel');
|
892
|
+
|
893
|
+
var handler = function()
|
894
|
+
{
|
895
|
+
$('#file').val($(el).text());
|
896
|
+
$('#redactorFileDeleteBtn').click(function()
|
897
|
+
{
|
898
|
+
this.fileDelete(el, file_id);
|
899
|
+
}.bind2(this));
|
900
|
+
|
901
|
+
$('#redactorFileDownloadBtn').click(function()
|
902
|
+
{
|
903
|
+
this.fileDownload(el, file_id);
|
904
|
+
}.bind2(this));
|
905
|
+
|
906
|
+
}.bind2(this);
|
907
|
+
|
908
|
+
redactorActive = this;
|
909
|
+
this.modalInit(RLANG.file, this.opts.paths.dialogs.fileEdit, 400, 200, handler);
|
910
|
+
},
|
911
|
+
fileDelete: function(el, file_id)
|
912
|
+
{
|
913
|
+
$(el).remove();
|
914
|
+
$.get(this.opts.paths.files.remove + file_id);
|
915
|
+
redactorActive.frame.get(0).contentWindow.focus();
|
916
|
+
this.modalClose();
|
917
|
+
},
|
918
|
+
fileDownload: function(el, file_id)
|
919
|
+
{
|
920
|
+
top.location.href = this.opts.paths.files.download + file_id;
|
921
|
+
},
|
922
|
+
|
923
|
+
/*
|
924
|
+
Table
|
925
|
+
*/
|
926
|
+
showTable: function()
|
927
|
+
{
|
928
|
+
redactorActive = this;
|
929
|
+
this.modalInit(RLANG.table, this.opts.paths.dialogs.table, 360, 200);
|
930
|
+
},
|
931
|
+
insertTable: function()
|
932
|
+
{
|
933
|
+
var rows = $('#redactor_table_rows').val();
|
934
|
+
var columns = $('#redactor_table_columns').val();
|
935
|
+
|
936
|
+
var table_box = $('<div></div>');
|
937
|
+
|
938
|
+
var tableid = Math.floor(Math.random() * 99999);
|
939
|
+
var table = $('<table id="table' + tableid + '"><tbody></tbody></table>');
|
940
|
+
|
941
|
+
for (i = 0; i < rows; i++)
|
942
|
+
{
|
943
|
+
var row = $('<tr></tr>')
|
944
|
+
for (z = 0; z < columns; z++)
|
945
|
+
{
|
946
|
+
var column = $('<td> </td>');
|
947
|
+
$(row).append(column);
|
948
|
+
}
|
949
|
+
$(table).append(row);
|
950
|
+
}
|
951
|
+
|
952
|
+
$(table_box).append(table);
|
953
|
+
var html = $(table_box).html();
|
954
|
+
if ($.browser.msie) html += '<p></p>';
|
955
|
+
else html += '<p> </p>';
|
956
|
+
|
957
|
+
redactorActive.execCommand('inserthtml', html);
|
958
|
+
this.enableObjects();
|
959
|
+
this.docObserve();
|
960
|
+
this.modalClose();
|
961
|
+
|
962
|
+
$table = $(this.doc).find('body').find('#table' + tableid);
|
963
|
+
|
964
|
+
|
965
|
+
},
|
966
|
+
tableObserver: function(e)
|
967
|
+
{
|
968
|
+
$table = $(e.target).parents('table');
|
969
|
+
|
970
|
+
$tbody = $(e.target).parents('tbody');
|
971
|
+
$thead = $($table).find('thead');
|
972
|
+
|
973
|
+
$current_td = $(e.target);
|
974
|
+
$current_tr = $(e.target).parents('tr');
|
975
|
+
},
|
976
|
+
deleteTable: function()
|
977
|
+
{
|
978
|
+
$($table).remove();
|
979
|
+
$table = false;
|
980
|
+
},
|
981
|
+
deleteRow: function()
|
982
|
+
{
|
983
|
+
$($current_tr).remove();
|
984
|
+
},
|
985
|
+
deleteColumn: function()
|
986
|
+
{
|
987
|
+
var index = $($current_td).attr('cellIndex');
|
988
|
+
|
989
|
+
$($table).find('tr').each(function()
|
990
|
+
{
|
991
|
+
$(this).find('td').eq(index).remove();
|
992
|
+
});
|
993
|
+
},
|
994
|
+
addHead: function()
|
995
|
+
{
|
996
|
+
if ($($table).find('thead').size() != 0) this.deleteHead();
|
997
|
+
else
|
998
|
+
{
|
999
|
+
var tr = $($table).find('tr').first().clone();
|
1000
|
+
tr.find('td').html(' ');
|
1001
|
+
$thead = $('<thead></thead>');
|
1002
|
+
$thead.append(tr);
|
1003
|
+
$($table).prepend($thead);
|
1004
|
+
}
|
1005
|
+
},
|
1006
|
+
deleteHead: function()
|
1007
|
+
{
|
1008
|
+
$($thead).remove();
|
1009
|
+
$thead = false;
|
1010
|
+
},
|
1011
|
+
insertRowAbove: function()
|
1012
|
+
{
|
1013
|
+
this.insertRow('before');
|
1014
|
+
},
|
1015
|
+
insertRowBelow: function()
|
1016
|
+
{
|
1017
|
+
this.insertRow('after');
|
1018
|
+
},
|
1019
|
+
insertColumnLeft: function()
|
1020
|
+
{
|
1021
|
+
this.insertColumn('before');
|
1022
|
+
},
|
1023
|
+
insertColumnRight: function()
|
1024
|
+
{
|
1025
|
+
this.insertColumn('after');
|
1026
|
+
},
|
1027
|
+
insertRow: function(type)
|
1028
|
+
{
|
1029
|
+
var new_tr = $($current_tr).clone();
|
1030
|
+
new_tr.find('td').html(' ');
|
1031
|
+
if (type == 'after') $($current_tr).after(new_tr);
|
1032
|
+
else $($current_tr).before(new_tr);
|
1033
|
+
},
|
1034
|
+
insertColumn: function(type)
|
1035
|
+
{
|
1036
|
+
var index = $($current_td).attr('cellIndex');
|
1037
|
+
|
1038
|
+
$($table).find('tr').each(function(i,s)
|
1039
|
+
{
|
1040
|
+
var current = $(s).find('td').eq(index);
|
1041
|
+
var td = current.clone();
|
1042
|
+
td.html(' ');
|
1043
|
+
if (type == 'after') $(current).after(td);
|
1044
|
+
else $(current).before(td);
|
1045
|
+
});
|
1046
|
+
},
|
1047
|
+
|
1048
|
+
/*
|
1049
|
+
Image
|
1050
|
+
*/
|
1051
|
+
imageEdit: function(e)
|
1052
|
+
{
|
1053
|
+
var handler = function()
|
1054
|
+
{
|
1055
|
+
var $el = $(e.target);
|
1056
|
+
var src = $el.attr('src');
|
1057
|
+
$('#redactor_image_edit_src').attr('href', src);
|
1058
|
+
$('#redactor_image_edit_delete').click(function() { this.deleteImage(e.target); }.bind2(this));
|
1059
|
+
$('#redactorSaveBtn').click(function() { this.imageSave(e.target); }.bind2(this));
|
1060
|
+
|
1061
|
+
$('#redactor_file_alt').val($el.attr('alt'));
|
1062
|
+
|
1063
|
+
var float = $el.css('float');
|
1064
|
+
if (float == 'none') float = 0;
|
1065
|
+
|
1066
|
+
$('#redactor_form_image_align').val(float);
|
1067
|
+
|
1068
|
+
}.bind2(this);
|
1069
|
+
|
1070
|
+
redactorActive = this;
|
1071
|
+
this.modalInit(RLANG.image, this.opts.paths.dialogs.imageEdit, 380, 290, handler);
|
1072
|
+
},
|
1073
|
+
imageSave: function(el)
|
1074
|
+
{
|
1075
|
+
$(el).attr('alt', $('#redactor_file_alt').val());
|
1076
|
+
|
1077
|
+
var style = '';
|
1078
|
+
if ($('#redactor_form_image_align') != 0)
|
1079
|
+
{
|
1080
|
+
var float = $('#redactor_form_image_align').val();
|
1081
|
+
|
1082
|
+
// @tanraya AddedClasses
|
1083
|
+
$(el).removeClass('img_left').removeClass('img_right')
|
1084
|
+
|
1085
|
+
if (float == 'left')
|
1086
|
+
$(el).addClass('img_left');
|
1087
|
+
else if (float == 'right')
|
1088
|
+
$(el).addClass('img_right')
|
1089
|
+
}
|
1090
|
+
else $(el).css({ float: 'none', margin: '0' });
|
1091
|
+
|
1092
|
+
this.modalClose();
|
1093
|
+
},
|
1094
|
+
deleteImage: function(el)
|
1095
|
+
{
|
1096
|
+
$(el).remove();
|
1097
|
+
this.modalClose();
|
1098
|
+
},
|
1099
|
+
showImage: function()
|
1100
|
+
{
|
1101
|
+
this.spanid = Math.floor(Math.random() * 99999);
|
1102
|
+
if (jQuery.browser.msie)
|
1103
|
+
{
|
1104
|
+
this.execCommand('inserthtml', '<span id="span' + this.spanid + '"></span>');
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
var handler = function() {
|
1108
|
+
if (this.opts.paths.images.list !== false) {
|
1109
|
+
$.getJSON(this.opts.paths.images.list, function(data) {
|
1110
|
+
$.each(data, function(key, val) {
|
1111
|
+
var img = $('<img src="' + val.thumb + '" rel="' + val.image + '">');
|
1112
|
+
img.click(function() { redactorActive.imageSetThumb($(this).attr('rel')); });
|
1113
|
+
$('#redactor_image_box').append(img);
|
1114
|
+
});
|
1115
|
+
});
|
1116
|
+
} else {
|
1117
|
+
$('#redactor_tabs li').eq(0).remove();
|
1118
|
+
$('#redactor_tabs a').eq(1).addClass('redactor_tabs_act');
|
1119
|
+
$('#redactor_tabs1').hide();
|
1120
|
+
$('#redactor_tabs2').show();
|
1121
|
+
}
|
1122
|
+
|
1123
|
+
// upload params
|
1124
|
+
//var params = '';
|
1125
|
+
//if (this.opts.imageUploadCallback) var params = this.opts.imageUploadCallback();
|
1126
|
+
alert(this.opts.imageUploadCallback)
|
1127
|
+
$('#redactor_file').dragupload({
|
1128
|
+
url : this.opts.paths.images.upload// + params,
|
1129
|
+
success : function(data) {
|
1130
|
+
this.imageUploadCallback(data);
|
1131
|
+
}.bind2(this)
|
1132
|
+
});
|
1133
|
+
|
1134
|
+
this.uploadInit('redactor_file', {
|
1135
|
+
auto : true,
|
1136
|
+
url : this.opts.paths.images.upload// + params,
|
1137
|
+
trigger : 'redactorUploadBtn',
|
1138
|
+
success : function(data) {
|
1139
|
+
this.imageUploadCallback(data);
|
1140
|
+
}.bind2(this)});
|
1141
|
+
}.bind2(this);
|
1142
|
+
|
1143
|
+
redactorActive = this;
|
1144
|
+
this.modalInit(RLANG.image, this.opts.paths.dialogs.image, 570, 450, handler);
|
1145
|
+
|
1146
|
+
},
|
1147
|
+
imageSetThumb: function(data)
|
1148
|
+
{
|
1149
|
+
this._imageSet('<img alt="" src="' + data + '" />');
|
1150
|
+
},
|
1151
|
+
imageUploadCallback: function(data)
|
1152
|
+
{
|
1153
|
+
if ($('#redactor_file_link').val() != '') data = $('#redactor_file_link').val();
|
1154
|
+
|
1155
|
+
this._imageSet(data);
|
1156
|
+
|
1157
|
+
},
|
1158
|
+
_imageSet: function(html)
|
1159
|
+
{
|
1160
|
+
redactorActive.frame.get(0).contentWindow.focus();
|
1161
|
+
|
1162
|
+
if ($.browser.msie)
|
1163
|
+
{
|
1164
|
+
$(redactorActive.doc.getElementById('span' + redactorActive.spanid)).after(html);
|
1165
|
+
$(redactorActive.doc.getElementById('span' + redactorActive.spanid)).remove();
|
1166
|
+
}
|
1167
|
+
else
|
1168
|
+
{
|
1169
|
+
redactorActive.execCommand('inserthtml', html);
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
this.modalClose();
|
1173
|
+
this.docObserve();
|
1174
|
+
},
|
1175
|
+
|
1176
|
+
|
1177
|
+
/*
|
1178
|
+
Link
|
1179
|
+
*/
|
1180
|
+
showLink: function()
|
1181
|
+
{
|
1182
|
+
redactorActive = this;
|
1183
|
+
|
1184
|
+
var handler = function()
|
1185
|
+
{
|
1186
|
+
var sel = this.get_selection();
|
1187
|
+
if ($.browser.msie)
|
1188
|
+
{
|
1189
|
+
var temp = sel.htmlText.match(/href="(.*?)"/gi);
|
1190
|
+
if (temp != null)
|
1191
|
+
{
|
1192
|
+
temp = new String(temp);
|
1193
|
+
temp = temp.replace(/href="(.*?)"/gi, '$1');
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
var text = sel.text;
|
1197
|
+
if (temp != null) var url = temp;
|
1198
|
+
else var url = '';
|
1199
|
+
var title = '';
|
1200
|
+
}
|
1201
|
+
else
|
1202
|
+
{
|
1203
|
+
if (sel.anchorNode.parentNode.tagName == 'A')
|
1204
|
+
{
|
1205
|
+
var url = sel.anchorNode.parentNode.href;
|
1206
|
+
var text = sel.anchorNode.parentNode.text;
|
1207
|
+
var title = sel.anchorNode.parentNode.title;
|
1208
|
+
if (sel.toString() == '') this.insert_link_node = sel.anchorNode.parentNode
|
1209
|
+
|
1210
|
+
}
|
1211
|
+
else
|
1212
|
+
{
|
1213
|
+
var text = sel.toString();
|
1214
|
+
var url = '';
|
1215
|
+
var title = '';
|
1216
|
+
}
|
1217
|
+
}
|
1218
|
+
|
1219
|
+
$('#redactor_link_url').val(url).focus();
|
1220
|
+
$('#redactor_link_text').val(text);
|
1221
|
+
$('#redactor_link_title').val(title);
|
1222
|
+
|
1223
|
+
}.bind2(this);
|
1224
|
+
|
1225
|
+
this.modalInit(RLANG.link, this.opts.paths.dialogs.link, 400, 300, handler);
|
1226
|
+
|
1227
|
+
},
|
1228
|
+
insertLink: function()
|
1229
|
+
{
|
1230
|
+
var value = $('#redactor_link_text').val();
|
1231
|
+
if (value == '') return true;
|
1232
|
+
|
1233
|
+
var title = $('#redactor_link_title').val();
|
1234
|
+
if (title != '') title = ' title="' + $('#redactor_link_title').val() + '"';
|
1235
|
+
|
1236
|
+
if ($('#redactor_link_id_url').get(0).checked) var mailto = '';
|
1237
|
+
else var mailto = 'mailto:';
|
1238
|
+
|
1239
|
+
var a = '<a href="' + mailto + $('#redactor_link_url').val() + '"' + title +'>' + value + '</a> ';
|
1240
|
+
|
1241
|
+
if (a)
|
1242
|
+
{
|
1243
|
+
if (this.insert_link_node)
|
1244
|
+
{
|
1245
|
+
$(this.insert_link_node).text(value);
|
1246
|
+
$(this.insert_link_node).attr('href', $('#redactor_link_url').val());
|
1247
|
+
|
1248
|
+
var title = $('#redactor_link_title').val();
|
1249
|
+
if (title != '') $(this.insert_link_node).attr('title', title);
|
1250
|
+
|
1251
|
+
this.modalClose();
|
1252
|
+
}
|
1253
|
+
else
|
1254
|
+
{
|
1255
|
+
redactorActive.frame.get(0).contentWindow.focus();
|
1256
|
+
redactorActive.execCommand('inserthtml', a);
|
1257
|
+
}
|
1258
|
+
}
|
1259
|
+
|
1260
|
+
this.modalClose();
|
1261
|
+
},
|
1262
|
+
|
1263
|
+
|
1264
|
+
/*
|
1265
|
+
Modal
|
1266
|
+
*/
|
1267
|
+
modalInit: function(title, url, width, height, handler, scroll)
|
1268
|
+
{
|
1269
|
+
if (this.opts.overlay)
|
1270
|
+
{
|
1271
|
+
$('#redactor_imp_modal_overlay').show();
|
1272
|
+
$('#redactor_imp_modal_overlay').click(function() { this.modalClose(); }.bind2(this));
|
1273
|
+
}
|
1274
|
+
|
1275
|
+
if ($('#redactor_imp_modal').size() == 0)
|
1276
|
+
{
|
1277
|
+
this.modal = $('<div id="redactor_imp_modal" style="display: none;"><div id="redactor_imp_modal_close"></div><div id="redactor_imp_modal_header"></div><div id="redactor_imp_modal_inner"></div></div>');
|
1278
|
+
$('body').append(this.modal);
|
1279
|
+
}
|
1280
|
+
|
1281
|
+
$('#redactor_imp_modal_close').click(function() { this.modalClose(); }.bind2(this));
|
1282
|
+
$(document).keyup(function(e) { if( e.keyCode == 27) this.modalClose(); }.bind2(this));
|
1283
|
+
$(this.doc).keyup(function(e) { if( e.keyCode == 27) this.modalClose(); }.bind2(this));
|
1284
|
+
|
1285
|
+
$.ajax({
|
1286
|
+
url: url,
|
1287
|
+
success: function(data)
|
1288
|
+
{
|
1289
|
+
// parse lang
|
1290
|
+
$.each(RLANG, function(i,s)
|
1291
|
+
{
|
1292
|
+
var re = new RegExp("%RLANG\." + i + "%","gi");
|
1293
|
+
data = data.replace(re, s);
|
1294
|
+
});
|
1295
|
+
|
1296
|
+
$('#redactor_imp_modal_inner').html(data);
|
1297
|
+
$('#redactor_imp_modal_header').html(title);
|
1298
|
+
|
1299
|
+
if (height === false) theight = 'auto';
|
1300
|
+
else theight = height + 'px';
|
1301
|
+
|
1302
|
+
$('#redactor_imp_modal').css({ width: width + 'px', height: theight, marginTop: '-' + height/2 + 'px', marginLeft: '-' + width/2 + 'px' }).fadeIn('fast');
|
1303
|
+
|
1304
|
+
if (scroll === true)
|
1305
|
+
{
|
1306
|
+
$('#imp_redactor_table_box').height(height-$('#redactor_imp_modal_header').outerHeight()-130).css('overflow', 'auto');
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
if (typeof(handler) == 'function') handler();
|
1310
|
+
|
1311
|
+
|
1312
|
+
}.bind2(this)
|
1313
|
+
});
|
1314
|
+
},
|
1315
|
+
modalClose: function()
|
1316
|
+
{
|
1317
|
+
|
1318
|
+
$('#redactor_imp_modal_close').unbind('click', function() { this.modalClose(); }.bind2(this));
|
1319
|
+
$('#redactor_imp_modal').fadeOut('fast', function()
|
1320
|
+
{
|
1321
|
+
$('#redactor_imp_modal_inner').html('');
|
1322
|
+
|
1323
|
+
if (this.opts.overlay)
|
1324
|
+
{
|
1325
|
+
$('#redactor_imp_modal_overlay').hide();
|
1326
|
+
$('#redactor_imp_modal_overlay').unbind('click', function() { this.modalClose(); }.bind2(this));
|
1327
|
+
}
|
1328
|
+
|
1329
|
+
$(document).unbind('keyup', function(e) { if( e.keyCode == 27) this.modalClose(); }.bind2(this));
|
1330
|
+
$(this.doc).unbind('keyup', function(e) { if( e.keyCode == 27) this.modalClose(); }.bind2(this));
|
1331
|
+
|
1332
|
+
}.bind2(this));
|
1333
|
+
|
1334
|
+
},
|
1335
|
+
|
1336
|
+
/*
|
1337
|
+
Upload
|
1338
|
+
*/
|
1339
|
+
uploadInit: function(element, options)
|
1340
|
+
{
|
1341
|
+
/*
|
1342
|
+
Options
|
1343
|
+
*/
|
1344
|
+
this.uploadOptions = {
|
1345
|
+
url: false,
|
1346
|
+
success: false,
|
1347
|
+
start: false,
|
1348
|
+
trigger: false,
|
1349
|
+
auto: false,
|
1350
|
+
input: false
|
1351
|
+
};
|
1352
|
+
|
1353
|
+
$.extend(this.uploadOptions, options);
|
1354
|
+
|
1355
|
+
|
1356
|
+
// Test input or form
|
1357
|
+
if ($('#' + element).get(0).tagName == 'INPUT')
|
1358
|
+
{
|
1359
|
+
this.uploadOptions.input = $('#' + element);
|
1360
|
+
this.element = $($('#' + element).get(0).form);
|
1361
|
+
}
|
1362
|
+
else
|
1363
|
+
{
|
1364
|
+
this.element = $('#' + element);
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
|
1368
|
+
this.element_action = this.element.attr('action');
|
1369
|
+
|
1370
|
+
// Auto or trigger
|
1371
|
+
if (this.uploadOptions.auto)
|
1372
|
+
{
|
1373
|
+
$(this.uploadOptions.input).change(function()
|
1374
|
+
{
|
1375
|
+
this.element.submit(function(e) { return false; });
|
1376
|
+
this.uploadSubmit();
|
1377
|
+
}.bind2(this));
|
1378
|
+
|
1379
|
+
}
|
1380
|
+
else if (this.uploadOptions.trigger)
|
1381
|
+
{
|
1382
|
+
$('#' + this.uploadOptions.trigger).click(function() { this.uploadSubmit(); }.bind2(this));
|
1383
|
+
}
|
1384
|
+
},
|
1385
|
+
uploadSubmit : function()
|
1386
|
+
{
|
1387
|
+
this.uploadForm(this.element, this.uploadFrame());
|
1388
|
+
},
|
1389
|
+
uploadFrame : function()
|
1390
|
+
{
|
1391
|
+
this.id = 'f' + Math.floor(Math.random() * 99999);
|
1392
|
+
|
1393
|
+
var d = document.createElement('div');
|
1394
|
+
var iframe = '<iframe style="display:none" src="about:blank" id="'+this.id+'" name="'+this.id+'"></iframe>';
|
1395
|
+
d.innerHTML = iframe;
|
1396
|
+
document.body.appendChild(d);
|
1397
|
+
|
1398
|
+
// Start
|
1399
|
+
if (this.uploadOptions.start) this.uploadOptions.start();
|
1400
|
+
|
1401
|
+
$('#' + this.id).load(function () { this.uploadLoaded() }.bind2(this));
|
1402
|
+
|
1403
|
+
return this.id;
|
1404
|
+
},
|
1405
|
+
uploadForm : function(f, name)
|
1406
|
+
{
|
1407
|
+
if (this.uploadOptions.input)
|
1408
|
+
{
|
1409
|
+
var formId = 'redactorUploadForm' + this.id;
|
1410
|
+
var fileId = 'redactorUploadFile' + this.id;
|
1411
|
+
this.form = $('<form action="' + this.uploadOptions.url + '" method="POST" target="' + name + '" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
|
1412
|
+
|
1413
|
+
var oldElement = this.uploadOptions.input;
|
1414
|
+
var newElement = $(oldElement).clone();
|
1415
|
+
$(oldElement).attr('id', fileId);
|
1416
|
+
$(oldElement).before(newElement);
|
1417
|
+
$(oldElement).appendTo(this.form);
|
1418
|
+
$(this.form).css('position', 'absolute');
|
1419
|
+
$(this.form).css('top', '-2000px');
|
1420
|
+
$(this.form).css('left', '-2000px');
|
1421
|
+
$(this.form).appendTo('body');
|
1422
|
+
|
1423
|
+
this.form.submit();
|
1424
|
+
}
|
1425
|
+
else
|
1426
|
+
{
|
1427
|
+
f.attr('target', name);
|
1428
|
+
f.attr('method', 'POST');
|
1429
|
+
f.attr('enctype', 'multipart/form-data');
|
1430
|
+
f.attr('action', this.uploadOptions.url);
|
1431
|
+
|
1432
|
+
this.element.submit();
|
1433
|
+
}
|
1434
|
+
|
1435
|
+
},
|
1436
|
+
uploadLoaded : function()
|
1437
|
+
{
|
1438
|
+
var i = $('#' + this.id);
|
1439
|
+
|
1440
|
+
if (i.contentDocument) var d = i.contentDocument;
|
1441
|
+
else if (i.contentWindow) var d = i.contentWindow.document;
|
1442
|
+
else var d = window.frames[this.id].document;
|
1443
|
+
|
1444
|
+
if (d.location.href == "about:blank") return true;
|
1445
|
+
|
1446
|
+
// Success
|
1447
|
+
if (this.uploadOptions.success) this.uploadOptions.success(d.body.innerHTML);
|
1448
|
+
|
1449
|
+
this.element.attr('action', this.element_action);
|
1450
|
+
this.element.attr('target', '');
|
1451
|
+
//this.element.unbind('submit');
|
1452
|
+
//if (this.uploadOptions.input) $(this.form).remove();
|
1453
|
+
},
|
1454
|
+
|
1455
|
+
/*
|
1456
|
+
Toolbar
|
1457
|
+
*/
|
1458
|
+
buildToolbar: function()
|
1459
|
+
{
|
1460
|
+
this.toolbar = $('<ul id="imp_redactor_toolbar_' + this.frameID + '" class="imp_redactor_toolbar"></ul>');
|
1461
|
+
|
1462
|
+
if (this.opts.air)
|
1463
|
+
{
|
1464
|
+
$(this.air).append(this.toolbar);
|
1465
|
+
this.box.prepend(this.air);
|
1466
|
+
}
|
1467
|
+
else $(this.box).prepend(this.toolbar);
|
1468
|
+
|
1469
|
+
|
1470
|
+
$.each(RTOOLBAR,
|
1471
|
+
function (i, s)
|
1472
|
+
{
|
1473
|
+
if (s.name == 'separator')
|
1474
|
+
{
|
1475
|
+
var li = $('<li class="separator"></li>');
|
1476
|
+
$(this.toolbar).append(li);
|
1477
|
+
}
|
1478
|
+
else
|
1479
|
+
{
|
1480
|
+
|
1481
|
+
var a = $('<a href="javascript:void(null);" class="imp_btn imp_btn_' + s.name + '" title="' + s.title + '"></a>');
|
1482
|
+
|
1483
|
+
if (typeof(s.func) == 'undefined') a.click(function() { this.execCommand(s.exec, s.name); }.bind2(this));
|
1484
|
+
else if (s.func != 'show') a.click(function(e) { this[s.func](e); }.bind2(this));
|
1485
|
+
|
1486
|
+
var li = $('<li class="imp_li_btn imp_li_btn_' + s.name + '"></li>');
|
1487
|
+
$(li).append(a);
|
1488
|
+
$(this.toolbar).append(li);
|
1489
|
+
|
1490
|
+
// build dropdown box
|
1491
|
+
if (s.name == 'backcolor' || s.name == 'fontcolor' || typeof(s.dropdown) != 'undefined')
|
1492
|
+
{
|
1493
|
+
var ul = $('<ul class="imp_redactor_drop_down imp_redactor_drop_down' + this.frameID + '" id="imp_redactor_drop_down' + this.frameID + '_' + s.name + '" style="display: none;"></ul>');
|
1494
|
+
if ($.browser.msie) ul.css({ borderLeft: '1px solid #ddd', borderRight: '1px solid #ddd', borderBottom: '1px solid #ddd' });
|
1495
|
+
}
|
1496
|
+
|
1497
|
+
// build dropdown
|
1498
|
+
if (typeof(s.dropdown) != 'undefined')
|
1499
|
+
{
|
1500
|
+
|
1501
|
+
$.each(s.dropdown,
|
1502
|
+
function (x, d)
|
1503
|
+
{
|
1504
|
+
if (typeof(d.style) == 'undefined') d.style = '';
|
1505
|
+
|
1506
|
+
if (d.name == 'separator')
|
1507
|
+
{
|
1508
|
+
var ul_li = $('<li class="separator_drop"></li>');
|
1509
|
+
$(ul).append(ul_li);
|
1510
|
+
}
|
1511
|
+
else
|
1512
|
+
{
|
1513
|
+
|
1514
|
+
var ul_li = $('<li></li>');
|
1515
|
+
var ul_li_a = $('<a href="javascript:void(null);" style="' + d.style + '">' + d.title + '</a>');
|
1516
|
+
$(ul_li).append(ul_li_a);
|
1517
|
+
$(ul).append(ul_li);
|
1518
|
+
|
1519
|
+
if (typeof(d.func) == 'undefined') $(ul_li_a).click(function() { this.execCommand(d.exec, d.name); }.bind2(this));
|
1520
|
+
else $(ul_li_a).click(function(e) { this[d.func](e); }.bind2(this));
|
1521
|
+
}
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
}.bind2(this)
|
1526
|
+
);
|
1527
|
+
}
|
1528
|
+
else a.mouseover(function() { this.hideAllDropDown() }.bind2(this));
|
1529
|
+
|
1530
|
+
// observing dropdown
|
1531
|
+
if (s.name == 'backcolor' || s.name == 'fontcolor' || typeof(s.dropdown) != 'undefined')
|
1532
|
+
{
|
1533
|
+
$('#imp_redactor_toolbar_' + this.frameID).after(ul);
|
1534
|
+
|
1535
|
+
this.hdlHideDropDown = function(e) { this.hideDropDown(e, ul, s.name) }.bind2(this);
|
1536
|
+
this.hdlShowDropDown = function(e) { this.showDropDown(e, ul, s.name) }.bind2(this);
|
1537
|
+
this.hdlShowerDropDown = function(e) { this.showerDropDown(e, ul, s.name) }.bind2(this);
|
1538
|
+
|
1539
|
+
a.click(this.hdlShowDropDown).mouseover(this.hdlShowerDropDown);
|
1540
|
+
|
1541
|
+
$(document).click(this.hdlHideDropDown);
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
|
1545
|
+
}
|
1546
|
+
}.bind2(this)
|
1547
|
+
);
|
1548
|
+
},
|
1549
|
+
|
1550
|
+
/*
|
1551
|
+
DropDown
|
1552
|
+
*/
|
1553
|
+
showedDropDown: false,
|
1554
|
+
showDropDown: function(e, ul, name)
|
1555
|
+
{
|
1556
|
+
|
1557
|
+
if (this.showedDropDown) this.hideAllDropDown();
|
1558
|
+
else
|
1559
|
+
{
|
1560
|
+
this.showedDropDown = true;
|
1561
|
+
this.showingDropDown(e, ul, name);
|
1562
|
+
}
|
1563
|
+
|
1564
|
+
},
|
1565
|
+
showingDropDown: function(e, ul, name)
|
1566
|
+
{
|
1567
|
+
this.hideAllDropDown();
|
1568
|
+
this.addSelButton(name);
|
1569
|
+
|
1570
|
+
var left = $('#imp_redactor_toolbar_' + this.frameID + ' li.imp_li_btn_' + name).position().left;
|
1571
|
+
$(ul).css('left', left + 'px').show();
|
1572
|
+
},
|
1573
|
+
showerDropDown: function(e, ul, name)
|
1574
|
+
{
|
1575
|
+
if (this.showedDropDown) this.showingDropDown(e, ul, name);
|
1576
|
+
},
|
1577
|
+
hideAllDropDown: function()
|
1578
|
+
{
|
1579
|
+
$('#imp_redactor_toolbar_' + this.frameID + ' li.imp_li_btn').removeClass('act');
|
1580
|
+
$('ul.imp_redactor_drop_down' + this.frameID).hide();
|
1581
|
+
},
|
1582
|
+
hideDropDown: function(e, ul, name)
|
1583
|
+
{
|
1584
|
+
if (!$(e.target).parent().hasClass('act'))
|
1585
|
+
{
|
1586
|
+
this.showedDropDown = false;
|
1587
|
+
this.hideAllDropDown();
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
$(document).unbind('click', this.hdlHideDropDown);
|
1591
|
+
$(this.doc).unbind('click', this.hdlHideDropDown);
|
1592
|
+
|
1593
|
+
},
|
1594
|
+
addSelButton: function(name)
|
1595
|
+
{
|
1596
|
+
var element = $('#imp_redactor_toolbar_' + this.frameID + ' li.imp_li_btn_' + name);
|
1597
|
+
element.addClass('act');
|
1598
|
+
},
|
1599
|
+
removeSelButton: function(name)
|
1600
|
+
{
|
1601
|
+
var element = $('#imp_redactor_toolbar_' + this.frameID + ' li.imp_li_btn_' + name);
|
1602
|
+
element.removeClass('act');
|
1603
|
+
},
|
1604
|
+
toggleSelButton: function(name)
|
1605
|
+
{
|
1606
|
+
$('#imp_redactor_toolbar_' + this.frameID + ' li.imp_li_btn_' + name).toggleClass('act');
|
1607
|
+
},
|
1608
|
+
|
1609
|
+
|
1610
|
+
/*
|
1611
|
+
Resizer
|
1612
|
+
*/
|
1613
|
+
initResize: function(e)
|
1614
|
+
{
|
1615
|
+
if (e.preventDefault) e.preventDefault();
|
1616
|
+
else e.returnValue = false;
|
1617
|
+
|
1618
|
+
this.splitter = e.target;
|
1619
|
+
|
1620
|
+
if (this.opts.visual)
|
1621
|
+
{
|
1622
|
+
this.element_resize = this.frame;
|
1623
|
+
this.element_resize.get(0).style.visibility = 'hidden';
|
1624
|
+
this.element_resize_parent = this.$el;
|
1625
|
+
}
|
1626
|
+
else
|
1627
|
+
{
|
1628
|
+
this.element_resize = this.$el;
|
1629
|
+
this.element_resize_parent = this.frame;
|
1630
|
+
}
|
1631
|
+
|
1632
|
+
this.stopResizeHdl = function (e) { this.stopResize(e) }.bind2(this);
|
1633
|
+
this.startResizeHdl = function (e) { this.startResize(e) }.bind2(this);
|
1634
|
+
this.resizeHdl = function (e) { this.resize(e) }.bind2(this);
|
1635
|
+
|
1636
|
+
$(document).mousedown(this.startResizeHdl);
|
1637
|
+
$(document).mouseup(this.stopResizeHdl);
|
1638
|
+
$(this.splitter).mouseup(this.stopResizeHdl);
|
1639
|
+
|
1640
|
+
this.null_point = false;
|
1641
|
+
this.h_new = false;
|
1642
|
+
this.h = this.element_resize.height();
|
1643
|
+
},
|
1644
|
+
startResize: function()
|
1645
|
+
{
|
1646
|
+
$(document).mousemove(this.resizeHdl);
|
1647
|
+
},
|
1648
|
+
resize: function(e)
|
1649
|
+
{
|
1650
|
+
if (e.preventDefault) e.preventDefault();
|
1651
|
+
else e.returnValue = false;
|
1652
|
+
|
1653
|
+
var y = e.pageY;
|
1654
|
+
if (this.null_point == false) this.null_point = y;
|
1655
|
+
if (this.h_new == false) this.h_new = this.element_resize.height();
|
1656
|
+
|
1657
|
+
var s_new = (this.h_new + y - this.null_point) - 10;
|
1658
|
+
|
1659
|
+
if (s_new <= 30) return true;
|
1660
|
+
|
1661
|
+
if (s_new >= 0)
|
1662
|
+
{
|
1663
|
+
this.element_resize.get(0).style.height = s_new + 'px';
|
1664
|
+
this.element_resize_parent.get(0).style.height = s_new + 'px';
|
1665
|
+
}
|
1666
|
+
},
|
1667
|
+
stopResize: function(e)
|
1668
|
+
{
|
1669
|
+
$(document).unbind('mousemove', this.resizeHdl);
|
1670
|
+
$(document).unbind('mousedown', this.startResizeHdl);
|
1671
|
+
$(document).unbind('mouseup', this.stopResizeHdl);
|
1672
|
+
$(this.splitter).unbind('mouseup', this.stopResizeHdl);
|
1673
|
+
|
1674
|
+
this.element_resize.get(0).style.visibility = 'visible';
|
1675
|
+
}
|
1676
|
+
|
1677
|
+
};
|
1678
|
+
|
1679
|
+
|
1680
|
+
String.prototype.isInlineName = function()
|
1681
|
+
{
|
1682
|
+
var inlineList = new Array("#text", "a", "em", "font", "span", "strong", "u");
|
1683
|
+
var theName = this.toLowerCase();
|
1684
|
+
|
1685
|
+
for (var i = 0; i < inlineList.length; i++)
|
1686
|
+
{
|
1687
|
+
if (theName == inlineList[i])
|
1688
|
+
{
|
1689
|
+
return true;
|
1690
|
+
}
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
return false;
|
1694
|
+
};
|
1695
|
+
|
1696
|
+
|
1697
|
+
// bind2
|
1698
|
+
Function.prototype.bind2 = function(object)
|
1699
|
+
{
|
1700
|
+
var method = this; var oldArguments = $.makeArray(arguments).slice(1);
|
1701
|
+
return function (argument)
|
1702
|
+
{
|
1703
|
+
if (argument == new Object) { method = null; oldArguments = null; }
|
1704
|
+
else if (method == null) throw "Attempt to invoke destructed method reference.";
|
1705
|
+
else { var newArguments = $.makeArray(arguments); return method.apply(object, oldArguments.concat(newArguments)); }
|
1706
|
+
};
|
1707
|
+
};
|
1708
|
+
|
1709
|
+
|
1710
|
+
})(jQuery);
|
1711
|
+
|
1712
|
+
// redactor_tabs
|
1713
|
+
function showRedactorTabs(el, index)
|
1714
|
+
{
|
1715
|
+
$('#redactor_tabs a').removeClass('redactor_tabs_act');
|
1716
|
+
$(el).addClass('redactor_tabs_act');
|
1717
|
+
|
1718
|
+
$('.redactor_tabs').hide();
|
1719
|
+
$('#redactor_tabs' + index).show();
|
1720
|
+
}
|
1721
|
+
;
|