Public
snipts » js
showing 1-20 of 47 snipts for js
-
∞ bijanvaez.com/image_upload_test/
<form action="/playground/ajax_upload" id="newHotnessForm">
-
∞ 6
thumb.attr('src', response); }
-
∞ 5
onComplete: function(file, response) { thumb.load(function(){ $('div.preview').removeClass('loading'); thumb.unbind(); });
-
∞ 4
onSubmit: function(file, extension) { $('div.preview').addClass('loading'); },
-
∞ 3
name: 'image',
-
∞ form example
jQuery(document).ready(function($){ var inputs_array = new Array('pol_name', 'kpp', 'inn', 'okato', 'rs', 'lsp', 'bank', 'bik', 'kor_schet', 'kbk', 'dest', 'fio', 'address', 'inn_plat', 'lspayer', 'sum_rub', 'sum_kop'); var defolts_array = new Array('?????????? ???????????? ???????????? ?? ?. ?????? (??? ??? ?? ???? ???? ?? ?. ??????)', '772101001', '7723320326', '45290554000', '40101810800000010041', '', '? ????????? 1 ??????????? ??? ????? ?????? ?. ?????? 705', '044583001', '', '18810807140010000110', '??????????????? ???????', '(??????? ???? ???)', '(??????? ??? ?????)', '', '', '', ''); var button_fill = $('#btn_fl'); button_fill.bind('click', function(){ var Current_Date = new Date(); $('select[name=date_dd] option:selected').attr('selected', 'no'); $('select[name=date_dd] option[value='+Current_Date.getDate()+']').attr('selected', 'yes'); $('select[name=date_mm] option:selected').attr('selected', 'no'); $('select[name=date_mm] option[value='+(Current_Date.getMonth()+1)+']').attr('selected', 'yes'); jQuery.each(inputs_array , function(i, input_name) { $('input[name=' + input_name + ']').val(defolts_array[i]); }); return false; }); })
-
∞ Test Javascript Document
<!doctype html> <body> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script> </script> </body>
-
∞ RegEx for checking format of JS function
^\s*?function\s*\(.*\)?\s*?{.*}\s*?$ -
∞ snow.js
<script type="text/javascript" src="http://oprod.net/scripts/snow.js"></script>
-
∞ Fade Joomla! Message
<script type="text/javascript" > var tmjmosmsg,fx; function pload(){ tmjmosmsg=$$('div.message'); if($type(tmjmosmsg[0])=='element'){ var el=tmjmosmsg[0]; el.setStyle('overflow','hidden'); var h=el.getSize().size.y; fx = new Fx.Styles(el, {duration:900, wait:false}); //scrol to message winScroller = new Fx.Scroll(window); winScroller.toElement($('header'));//name of header div //delayed start, then remove the html element upon completion (function(){ fx.start({ 'margin-top':-1*h.toInt(), opacity:0 }).chain(function(){el.remove();}); }).delay(2500); } }; window.addEvent('load',function(){ pload(); } ); </script>
-
∞ Count the number of DOM elements
document.getElementsByTagName('*').length
-
∞ SilverStripe JS code, from admin section. Actual inline code. Sheesh.
<script type="text/javascript" src="http://demo.silverstripe.com/jsparty/firebug/firebugx.js?m=1231191085"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/prototype.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/jquery/jquery.js?m=1231191085"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/jquery/jquery_improvements.js?m=1231191085"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/behaviour.js?m=1248298187"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/jquery/plugins/livequery/jquery.livequery.js?m=1231191082"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/core/jquery.ondemand.js?m=1234352143"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/prototype_improvements.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/loader.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/hover.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/layout_helpers.js?m=1239001187"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/i18n.js?m=1236731522"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/lang/en_US.js?m=1231191091"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/lang/en_US.js?m=1231191081"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/scriptaculous/effects.js?m=1231191085"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/scriptaculous/dragdrop.js?m=1231191085"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/scriptaculous/controls.js?m=1231191085"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/greybox/AmiJS.js?m=1231191082"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/greybox/greybox.js?m=1232484099"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/tree/tree.js?m=1231799982"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/LeftAndMain.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/LeftAndMain_left.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/LeftAndMain_right.js?m=1241738972"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/SideTabs.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/SideReports.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/LangSelector.js?m=1241738972"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/TranslationTab.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/subsites/javascript/LeftAndMain_Subsites.js?m=1248298193"></script><script type="text/javascript" src="http://demo.silverstripe.com/subsites/javascript/VirtualPage_Subsites.js?m=1248298193"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/CMSMain.js?m=1231191081"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/CMSMain_left.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/CMSMain_right.js?m=1241738972"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/calendar/calendar.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/calendar/lang/calendar-en.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/calendar/calendar-setup.js?m=1231191086"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/tiny_mce2/tiny_mce_src.js?m=1239001187"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/SitetreeAccess.js?m=1231191081"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/UpdateURL.js?m=1236731522"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/Validator.js?m=1236731522"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/tabstrip/tabstrip.js?m=1241738973"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/UniqueFields.js?m=1236731522"></script><script type="text/javascript" src="http://demo.silverstripe.com/sapphire/javascript/TreeSelectorField.js?m=1248298189"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/tiny_mce_improvements.js?m=1248298187"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/TinyMCEImageEnhancement.js?m=1248298186"></script><script type="text/javascript" src="http://demo.silverstripe.com/jsparty/SWFUpload/SWFUpload.js?m=1233180404"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/Upload.js?m=1233712538"></script><script type="text/javascript" src="http://demo.silverstripe.com/cms/javascript/ThumbnailStripField.js?m=1231191081"></script><script type="text/javascript">//<![CDATA[ Behaviour.addLoader(hideLoading); //]]></script><script type="text/javascript">//<![CDATA[ siteTreeHints = { Root : { allowedChildren : [ 'SiteTree', 'Page', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] } , SiteTree : { allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '', allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] } , GhostPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] } , Page : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , BlogEntry : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , BlogTree : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'BlogTree', 'BlogHolder', 'BlogHolder' ] , defaultChild : 'BlogTree', defaultParent : '' } , AccountPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , CheckoutPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , Product : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , ProductGroup : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Product', defaultParent : '' } , FlickrGallery : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , Forum : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : '', defaultChild : '', defaultParent : '' } , ForumHolder : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'Forum' ] , defaultChild : 'Forum', defaultParent : '' } , ForumMemberMapPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , GMapPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , GMapPolylinePage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , ErrorPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , RedirectorPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , VirtualPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , AboutUsHome : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , HomePage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , MetaBlog : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , UserDefinedForm : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , YoutubeGallery : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } , BlogHolder : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'BlogTree', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'BlogEntry' ] , defaultChild : 'BlogEntry', defaultParent : '' } , SubsitesVirtualPage : { allowedParents : [ 'SiteTree', 'Page', 'BlogEntry', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'SubsitesVirtualPage' ] , allowedChildren : [ 'SiteTree', 'GhostPage', 'Page', 'BlogEntry', 'BlogTree', 'AccountPage', 'CheckoutPage', 'Product', 'ProductGroup', 'FlickrGallery', 'Forum', 'ForumHolder', 'ForumMemberMapPage', 'GMapPage', 'GMapPolylinePage', 'ErrorPage', 'RedirectorPage', 'VirtualPage', 'AboutUsHome', 'HomePage', 'MetaBlog', 'UserDefinedForm', 'YoutubeGallery', 'BlogHolder', 'SubsitesVirtualPage' ] , defaultChild : 'Page', defaultParent : '' } } ; //]]></script><script type="text/javascript">//<![CDATA[ var _TREE_ICONS = []; _TREE_ICONS['SiteTree'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['Page'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['BlogEntry'] = { fileIcon: 'blog/images/blogpage-file.gif', openFolderIcon: 'blog/images/blogpage-file.gif', closedFolderIcon: 'blog/images/blogpage-file.gif' }; _TREE_ICONS['BlogTree'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['AccountPage'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['CheckoutPage'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['Product'] = { fileIcon: 'cms/images/treeicons/book-file.gif', openFolderIcon: 'cms/images/treeicons/book-file.gif', closedFolderIcon: 'cms/images/treeicons/book-file.gif' }; _TREE_ICONS['ProductGroup'] = { fileIcon: 'cms/images/treeicons/folder-file.gif', openFolderIcon: 'cms/images/treeicons/folder-file.gif', closedFolderIcon: 'cms/images/treeicons/folder-file.gif' }; _TREE_ICONS['FlickrGallery'] = { fileIcon: 'flickrservice/images/flickr-file.gif', openFolderIcon: 'flickrservice/images/flickr-file.gif', closedFolderIcon: 'flickrservice/images/flickr-file.gif' }; _TREE_ICONS['Forum'] = { fileIcon: 'forum/images/treeicons/user-file.gif', openFolderIcon: 'forum/images/treeicons/user-file.gif', closedFolderIcon: 'forum/images/treeicons/user-file.gif' }; _TREE_ICONS['ForumHolder'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['ForumMemberMapPage'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['GMapPage'] = { fileIcon: 'maps/images/treeicons/map-file.gif', openFolderIcon: 'maps/images/treeicons/map-file.gif', closedFolderIcon: 'maps/images/treeicons/map-file.gif' }; _TREE_ICONS['GMapPolylinePage'] = { fileIcon: 'maps/images/treeicons/map-file.gif', openFolderIcon: 'maps/images/treeicons/map-file.gif', closedFolderIcon: 'maps/images/treeicons/map-file.gif' }; _TREE_ICONS['ErrorPage'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['RedirectorPage'] = { fileIcon: 'cms/images/treeicons/page-shortcut-file.gif', openFolderIcon: 'cms/images/treeicons/page-shortcut-file.gif', closedFolderIcon: 'cms/images/treeicons/page-shortcut-file.gif' }; _TREE_ICONS['VirtualPage'] = { fileIcon: 'cms/images/treeicons/page-shortcut-gold-file.gif', openFolderIcon: 'cms/images/treeicons/page-shortcut-gold-file.gif', closedFolderIcon: 'cms/images/treeicons/page-shortcut-gold-file.gif' }; _TREE_ICONS['AboutUsHome'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['HomePage'] = { fileIcon: 'jsparty/tree/images/page-file.gif', openFolderIcon: 'jsparty/tree/images/page-file.gif', closedFolderIcon: 'jsparty/tree/images/page-file.gif' }; _TREE_ICONS['MetaBlog'] = { fileIcon: 'metablogservice/images/technorati-file.gif', openFolderIcon: 'metablogservice/images/technorati-file.gif', closedFolderIcon: 'metablogservice/images/technorati-file.gif' }; _TREE_ICONS['UserDefinedForm'] = { fileIcon: 'cms/images/treeicons/task-file.gif', openFolderIcon: 'cms/images/treeicons/task-file.gif', closedFolderIcon: 'cms/images/treeicons/task-file.gif' }; _TREE_ICONS['YoutubeGallery'] = { fileIcon: 'youtubeservice/images/youtube-file.gif', openFolderIcon: 'youtubeservice/images/youtube-file.gif', closedFolderIcon: 'youtubeservice/images/youtube-file.gif' }; _TREE_ICONS['BlogHolder'] = { fileIcon: 'blog/images/blogholder-file.gif', openFolderIcon: 'blog/images/blogholder-file.gif', closedFolderIcon: 'blog/images/blogholder-file.gif' }; _TREE_ICONS['SubsitesVirtualPage'] = { fileIcon: 'cms/images/treeicons/page-shortcut-gold-file.gif', openFolderIcon: 'cms/images/treeicons/page-shortcut-gold-file.gif', closedFolderIcon: 'cms/images/treeicons/page-shortcut-gold-file.gif' }; _TREE_ICONS['BrokenLink'] = { fileIcon: 'cms/images/treeicons/brokenlink-file.gif', openFolderIcon: 'cms/images/treeicons/brokenlink-file.gif', closedFolderIcon: 'cms/images/treeicons/brokenlink-file.gif' }; //]]></script><script type="text/javascript">//<![CDATA[ if((typeof tinyMCE != 'undefined')) { tinyMCE.init({"mode":"none","editor_selector":"htmleditor","width":"100%","auto_resize":false,"theme":"advanced","theme_advanced_layout_manager":"SimpleLayout","theme_advanced_toolbar_location":"top","theme_advanced_toolbar_align":"left","theme_advanced_toolbar_parent":"right","blockquote_clear_tag":"p","table_inline_editing":true,"safari_warning":false,"relative_urls":true,"verify_html":true,"language":"en","content_css":"cms\/css\/editor.css, ss2demo\/css\/editor.css","body_class":"typography","document_base_url":"http:\/\/demo.silverstripe.com\/","urlconverter_callback":"nullConverter","setupcontent_callback":"sapphiremce_setupcontent","cleanup_callback":"sapphiremce_cleanup","template_templates":[{"title":"Three column","src":"assets\/snippet.html","description":"A simple 3 column layout"}],"use_native_selects":true,"valid_elements":"+a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong\/-b[class],-em\/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],-td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir]","extended_valid_elements":"img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]","spellchecker_languages":"+English=en_US,French=fr_FR,Norwegian Bokmal (Norway)=nb_NO,Romanian=ro_RO,Chinese (China)=zh_CN","plugins":"contextmenu,table,emotions,paste,..\/..\/tinymce_advcode,spellchecker,media,..\/..\/tinymce_ssbuttons,fullscreen","theme_advanced_buttons1":"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,separator,bullist,numlist,outdent,indent,blockquote,hr,charmap","theme_advanced_buttons2":"undo,redo,separator,cut,copy,paste,pastetext,pasteword,spellchecker,separator,ssimage,ssflash,sslink,unlink,anchor,separator,advcode,fullscreen,separator,search,replace,selectall,visualaid,separator","theme_advanced_buttons3":"tablecontrols"}); } //]]></script><script type="text/javascript">//<![CDATA[ Behaviour.register({ '#Form_EditForm': { validate : function(fromAnOnBlur) { initialiseForm(this, fromAnOnBlur); var error = hasHadFormError(); if(!error && fromAnOnBlur) clearErrorMessage(fromAnOnBlur); return !error; }, onsubmit : function() { if(typeof this.bypassValidation == 'undefined' || !this.bypassValidation) return this.validate(); } }, '#Form_EditForm input' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } if(!this.old_onfocus) this.old_onfocus = function() { return true; } }, onblur : function() { if(this.old_onblur()) { // Don't perform instant validation for CalendarDateField fields; it creates usability wierdness. if(this.parentNode.className.indexOf('calendardate') == -1 || this.value) { return $('Form_EditForm').validate(this); } else { return true; } } } }, '#Form_EditForm select' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } }, onblur : function() { if(this.old_onblur()) { return $('Form_EditForm').validate(this); } } } }); //]]></script><script type="text/javascript">//<![CDATA[ Behaviour.register({ '#Form_EditorToolbarImageForm': { validate : function(fromAnOnBlur) { initialiseForm(this, fromAnOnBlur); var error = hasHadFormError(); if(!error && fromAnOnBlur) clearErrorMessage(fromAnOnBlur); return !error; }, onsubmit : function() { if(typeof this.bypassValidation == 'undefined' || !this.bypassValidation) return this.validate(); } }, '#Form_EditorToolbarImageForm input' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } if(!this.old_onfocus) this.old_onfocus = function() { return true; } }, onblur : function() { if(this.old_onblur()) { // Don't perform instant validation for CalendarDateField fields; it creates usability wierdness. if(this.parentNode.className.indexOf('calendardate') == -1 || this.value) { return $('Form_EditorToolbarImageForm').validate(this); } else { return true; } } } }, '#Form_EditorToolbarImageForm select' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } }, onblur : function() { if(this.old_onblur()) { return $('Form_EditorToolbarImageForm').validate(this); } } } }); //]]></script><script type="text/javascript">//<![CDATA[ Behaviour.register({ "#Form_EditorToolbarLinkForm": { validateEmailField: function(fieldName) { var el = _CURRENT_FORM.elements[fieldName]; if(!el || !el.value) return true; if(el.value.match(/^([a-zA-Z0-9_+\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/)) { return true; } else { validationError(el, "Please enter an email address.","validation"); return false; } } } }); //]]></script><script type="text/javascript">//<![CDATA[ Behaviour.register({ '#Form_EditorToolbarLinkForm': { validate : function(fromAnOnBlur) { initialiseForm(this, fromAnOnBlur); if(typeof fromAnOnBlur != 'undefined'){ if(fromAnOnBlur.name == 'email') $('Form_EditorToolbarLinkForm').validateEmailField('email'); }else{ $('Form_EditorToolbarLinkForm').validateEmailField('email'); } var error = hasHadFormError(); if(!error && fromAnOnBlur) clearErrorMessage(fromAnOnBlur); return !error; }, onsubmit : function() { if(typeof this.bypassValidation == 'undefined' || !this.bypassValidation) return this.validate(); } }, '#Form_EditorToolbarLinkForm input' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } if(!this.old_onfocus) this.old_onfocus = function() { return true; } }, onblur : function() { if(this.old_onblur()) { // Don't perform instant validation for CalendarDateField fields; it creates usability wierdness. if(this.parentNode.className.indexOf('calendardate') == -1 || this.value) { return $('Form_EditorToolbarLinkForm').validate(this); } else { return true; } } } }, '#Form_EditorToolbarLinkForm select' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } }, onblur : function() { if(this.old_onblur()) { return $('Form_EditorToolbarLinkForm').validate(this); } } } }); //]]></script><script type="text/javascript">//<![CDATA[ Behaviour.register({ '#Form_EditorToolbarFlashForm': { validate : function(fromAnOnBlur) { initialiseForm(this, fromAnOnBlur); var error = hasHadFormError(); if(!error && fromAnOnBlur) clearErrorMessage(fromAnOnBlur); return !error; }, onsubmit : function() { if(typeof this.bypassValidation == 'undefined' || !this.bypassValidation) return this.validate(); } }, '#Form_EditorToolbarFlashForm input' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } if(!this.old_onfocus) this.old_onfocus = function() { return true; } }, onblur : function() { if(this.old_onblur()) { // Don't perform instant validation for CalendarDateField fields; it creates usability wierdness. if(this.parentNode.className.indexOf('calendardate') == -1 || this.value) { return $('Form_EditorToolbarFlashForm').validate(this); } else { return true; } } } }, '#Form_EditorToolbarFlashForm select' : { initialise: function() { if(!this.old_onblur) this.old_onblur = function() { return true; } }, onblur : function() { if(this.old_onblur()) { return $('Form_EditorToolbarFlashForm').validate(this); } } } }); //]]></script>
-
∞ Javscript: convert text so quotes and symbols will appear in input textfields correctly.
// Javscript: convert text so quotes and symbols will // appear in input textfields correctly. function htmlEntities(s) { var i,x,y=''; for(i=0;i<s.length;i++){ x = s[i].charCodeAt(0); if( (x > 47 && x < 58) || (x > 62 && x < 127) ){ y += s[i]; }else{ y += "&#" + x + ";"; } } return y; }
-
∞ 10,234,567,890,
var mf=function (s){ var sl = s.length; var sk = sl%3; //document.write(sk); var ss = ''; for(i=0;i<sl;i++){ if(i>sk-1){ if((i-sk)%3==0 && i!=0){ ss +=','; } ss +=s[i]; }else{ ss +=s[i]; } } document.write(ss); } var a = '12345678955555555345325444'; mf(a);
-
∞ 1,234,567,890
var arr = []; var a = function(n){ if(n==0) return; if(String(n).length<3){ arr.unshift(String(n)); return arr; } n = n/1000; arr.unshift(n.toFixed(3).split('.')[1]); n = Number(n.toString().split('.')[0]) a(n); } a(1234567890) console.log(arr) console.log(arr.join(','))
-
∞ Iterating over DOM attributes
if (node.attributes.length) { // Get the known-existent list of attributes and iterate over them var attrs = node.attributes; for (var length = attrs.length, i = 0; i < length; i++) { // IE 5-8 (all currently shipping versions) always list all possible attributes, specified or not. // The "specified" member of each attribute indicates whether it was existent in the HTML and is required for the purpose here. // IE will also report the unique jQuery identifiers as well as jQuery's sizzle engine cache attributes, so parse those out entirely. if (attrs[i].specified && attrs[i].nodeName.indexOf('jQuery') == -1 && attrs[i].nodeName.indexOf('sizcache') == -1 && attrs[i].nodeName.indexOf('sizset') == -1) { // Ensure quotes won't break the string and add the now parsed attribute to the array xml_array.push(' '+attrs[i].nodeName+'="'+attrs[i].nodeValue.replace(/\"/g, """)+'"'); } } }
-
∞ Unsetting Mootools in J! Head
$headerjs = $this -> getHeadData ( ) ; headerjs $ = $ this -> getHeadData (); reset ( $headerjs [ 'scripts' ] ) ; reset ($ headerjs [ 'scripts']); foreach ( $headerjs [ 'scripts' ] as $script => $type ) { foreach ($ headerjs [ 'scripts'] as $ script => $ type) ( if ( ( strpos ( $script , 'mootools.js' ) ) or ( strpos ( $script , 'caption.js' ) ) ) { if ((strpos ($ script, 'mootools.js')) or (strpos ($ script, 'caption.js'))) ( unset ( $headerjs [ 'scripts' ] [ $script ] ) ; unset ($ headerjs [ 'scripts'] [$ script]); } ) } ) $this -> setHeadData ( $headerjs ) ; $ this -> setHeadData ($ headerjs);
-
∞ <script> tag CDATA
<script type="text/javascript"> /* <![CDATA[ */ //JS Code here /* ]]> */ </script>
-
∞ I use this to start building xml in javascript, might be well common but, you might like my way. anyways with this you can simply start out your xml functions with var xmlDoc = makeXML(); i like it :)
function makeXML() { try //Internet Explorer { return xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); } catch(e) { try //Firefox, Mozilla, Opera, etc. { return xmlDoc=document.implementation.createDocument("","",null); } catch(e) { alert(e.message); return; } } }
-
∞ SWFobject dynamic
<script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"> var flashvars = false; var params = { menu: "false", wmode: "transparent", flashvars: "" }; var attributes = { id: "myDynamicContent", name: "myDynamicContent" }; swfobject.embedSWF("flash/multiRotator.swf", "bannerTeaser", "950", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes); </script>



Programming in Python 3