By uilab on
Automatically generate embedded code for very terror, Is there any way to optimize or delete?
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath":"\u002F", "pathPrefix":"", "ajaxPageState":{"theme":"uilabnet", "theme_token":"58xSkFNFvAxnlzZHJ94LyE-h694hZhotGcg_tV3oWpU", "js":{"misc\u002Fjquery.js":1, "misc\u002Fjquery.once.js":1, "misc\u002Fdrupal.js":1, "misc\u002Fui\u002Fjquery.ui.core.min.js":1, "misc\u002Fui\u002Fjquery.ui.widget.min.js":1, "misc\u002Fui\u002Fjquery.effects.core.min.js":1, "misc\u002Fjquery.ba-bbq.js":1, "modules\u002Foverlay\u002Foverlay-parent.js":1, "misc\u002Fui\u002Fjquery.ui.mouse.min.js":1, "misc\u002Fui\u002Fjquery.ui.draggable.min.js":1, "misc\u002Fui\u002Fjquery.ui.droppable.min.js":1, "misc\u002Fui\u002Fjquery.ui.sortable.min.js":1, "sites\u002Fall\u002Fmodules\u002Fbeautytips\u002Fjs\u002Fjquery.bt.min.js":1, "sites\u002Fall\u002Fmodules\u002Fbeautytips\u002Fjs\u002Fbeautytips.min.js":1, "modules\u002Fcontextual\u002Fcontextual.js":1, "misc\u002Fjquery.cookie.js":1, "sites\u002Fall\u002Fmodules\u002Fback_to_top\u002Fback_to_top.js":1, "public:\u002F\u002Flanguages\u002Fzh-hans_KljMCBmO_YJ4kmafXFy6f59QOsZRlMhfScwIkKR-vNM.js":1, "sites\u002Fall\u002Flibraries\u002Fcolorbox\u002Fcolorbox\u002Fjquery.colorbox-min.js":1, "sites\u002Fall\u002Fmodules\u002Fcolorbox\u002Fjs\u002Fcolorbox.js":1, "sites\u002Fall\u002Fmodules\u002Fcolorbox\u002Fjs\u002Fcolorbox_load.js":1, "sites\u002Fall\u002Fmodules\u002Fcolorbox\u002Fjs\u002Fcolorbox_inline.js":1, "sites\u002Fall\u002Fmodules\u002Fnice_menus\u002Fsuperfish\u002Fjs\u002Fsuperfish.js":1, "sites\u002Fall\u002Fmodules\u002Fnice_menus\u002Fsuperfish\u002Fjs\u002Fjquery.bgiframe.min.js":1, "sites\u002Fall\u002Fmodules\u002Fnice_menus\u002Fsuperfish\u002Fjs\u002Fjquery.hoverIntent.minified.js":1, "sites\u002Fall\u002Fmodules\u002Fnice_menus\u002Fnice_menus.js":1, "sites\u002Fall\u002Fmodules\u002Fpanels\u002Fjs\u002Fpanels.js":1, "sites\u002Fall\u002Fmodules\u002Fextlink\u002Fextlink.js":1, "sites\u002Fall\u002Flibraries\u002Fjquery.cycle\u002Fjquery.cycle.all.min.js":1, "sites\u002Fall\u002Fmodules\u002Fddblock\u002Fjs\u002Fjson2.pack.js":1, "sites\u002Fall\u002Fmodules\u002Fddblock\u002Fjs\u002Fddblock.js":1, "sites\u002Fall\u002Fmodules\u002Fcontext\u002Fplugins\u002Fcontext_reaction_block.js":1, "sites\u002Fall\u002Fmodules\u002Fgoogle_analytics\u002Fgoogleanalytics.js":1, "0":1, "modules\u002Ftoolbar\u002Ftoolbar.js":1}, "css":{"modules\u002Fsystem\u002Fsystem.base.css":1, "modules\u002Fsystem\u002Fsystem.messages.css":1, "modules\u002Fsystem\u002Fsystem.theme.css":1, "misc\u002Fui\u002Fjquery.ui.core.css":1, "misc\u002Fui\u002Fjquery.ui.theme.css":1, "modules\u002Foverlay\u002Foverlay-parent.css":1, "modules\u002Fcontextual\u002Fcontextual.css":1, "sites\u002Fall\u002Fmodules\u002Fback_to_top\u002Fback_to_top.css":1, "modules\u002Fbook\u002Fbook.css":1, "sites\u002Fall\u002Fmodules\u002Fcalendar\u002Fcss\u002Fcalendar_multiday.css":1, "sites\u002Fall\u002Fmodules\u002Fcalendar_tooltips\u002Fcalendar_tooltips.css":1, "sites\u002Fall\u002Fmodules\u002Fdate\u002Fdate_api\u002Fdate.css":1, "sites\u002Fall\u002Fmodules\u002Fdate\u002Fdate_popup\u002Fthemes\u002Fdatepicker.1.7.css":1, "sites\u002Fall\u002Fmodules\u002Fdate\u002Fdate_repeat_field\u002Fdate_repeat_field.css":1, "sites\u002Fall\u002Fmodules\u002Fdate-time-field\u002Fcss\u002Fsmoothness\u002Fjquery-ui-1.8.14.custom.css":1, "modules\u002Ffield\u002Ftheme\u002Ffield.css":1, "modules\u002Fnode\u002Fnode.css":1, "modules\u002Fpoll\u002Fpoll.css":1, "modules\u002Fsearch\u002Fsearch.css":1, "modules\u002Fforum\u002Fforum.css":1, "sites\u002Fall\u002Fmodules\u002Fviews\u002Fcss\u002Fviews.css":1, "sites\u002Fall\u002Flibraries\u002Fcolorbox\u002Fexample2\u002Fcolorbox.css":1, "sites\u002Fall\u002Fmodules\u002Fctools\u002Fcss\u002Fctools.css":1, "sites\u002Fall\u002Fmodules\u002Fnice_menus\u002Fnice_menus.css":1, "sites\u002Fall\u002Fmodules\u002Fnice_menus\u002Fnice_menus_default.css":1, "sites\u002Fall\u002Fmodules\u002Fpanels\u002Fcss\u002Fpanels.css":1, "sites\u002Fall\u002Fmodules\u002Fextlink\u002Fextlink.css":1, "sites\u002Fall\u002Fmodules\u002Fddblock\u002Fcss\u002Fddblock.css":1, "sites\u002Fall\u002Fmodules\u002Fcontext\u002Fplugins\u002Fcontext_reaction_block.css":1, "modules\u002Fshortcut\u002Fshortcut.css":1, "modules\u002Ftoolbar\u002Ftoolbar.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fnice_menus_custom.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Flayout.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fstyle.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fmaintenance-page.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fsystem.menus.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fnode-forum.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fuser.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fcomment.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fscroll_to_top.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fprint.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fie.css":1, "sites\u002Fall\u002Fthemes\u002Fuilabnet\u002Fcss\u002Fie6.css":1}}, "back_to_top":{"back_to_top_prevent_on_mobile":0, "back_to_top_prevent_in_admin":0, "back_to_top_button_type":"image"}, "colorbox":{"opacity":"0.85", "current":"{current} of {total}", "previous":"« Prev", "next":"Next »", "close":"Close", "maxWidth":"100%", "maxHeight":"100%", "fixed":true, "__drupal_alter_by_ref":[ "sites\u002Fall\u002Flibraries\u002Fcolorbox\u002Fexample2" ]}, "nice_menus_options":{"delay":800, "speed":1}, "overlay":{"paths":{"admin":"node\u002F*\u002Fwebform\u000Anode\u002F*\u002Fwebform\u002F*\u000Anode\u002F*\u002Fwebform-results\u000Anode\u002F*\u002Fwebform-results\u002F*\u000Anode\u002F*\u002Fsubmission\u002F*\u000Anode\u002F*\u002Foutline\u000Anode\u002F*\u002Foutline\u002Fremove\u000Anode\u002F*\u002Fedit\u000Anode\u002F*\u002Fdelete\u000Anode\u002F*\u002Frevisions\u000Anode\u002F*\u002Frevisions\u002F*\u002Frevert\u000Anode\u002F*\u002Frevisions\u002F*\u002Fdelete\u000Anode\u002Fadd\u000Anode\u002Fadd\u002F*\u000Aoverlay\u002Fdismiss-message\u000Auser\u002F*\u002Fshortcuts\u000Aadmin\u000Aadmin\u002F*\u000Abatch\u000Ataxonomy\u002Fterm\u002F*\u002Fedit\u000Anode\u002F*\u002Ftranslate\u000Auser\u002F*\u002Fcancel\u000Auser\u002F*\u002Fedit\u000Auser\u002F*\u002Fedit\u002F*", "non_admin":"admin\u002Fstructure\u002Fblock\u002Fdemo\u002F*\u000Aadmin\u002Freports\u002Fstatus\u002Fphp"}, "ajaxCallback":"overlay-ajax"}, "extlink":{"extTarget":"_blank", "extClass":"ext", "extSubdomains":1, "extExclude":"", "extInclude":"", "extAlert":0, "extAlertText":"This link will take you to an external web site. We are not responsible for their content.", "mailtoClass":"mailto"}, "ddblockImageContainer":{"1":{"block":"1", "contentContainer":"div.slide", "imageContainerHeight":"0", "imageContainerWidth":"0", "setDimensions":"none"}}, "ddblockImages":{"1":{"block":"1", "contentContainer":"div.slide", "imageHeight":"0", "imageWidth":"0", "setDimensions":"none"}}, "ddblockContent":{"1":{"block":"1", "nrOfItems":2, "setDimensions":"none", "contentContainer":"div.slide", "custom":"", "fx":"fade", "easeOut":"linear", "easeIn":"linear", "speed":"500", "timeOut":"5000", "pause":"1", "next":"1", "overflow":"hidden", "pager":"prev-next-pager", "pagerPosition":"top", "pagerPrevNextLoop":"1", "pagerScrollableLoop":"1", "nrOfPagerItems":"4", "pagerContainer":"pager-item", "pagerEvent":"mouseover", "pagerDisableClick":"1", "pagerFast":"1", "pagerPause":"1", "pager2":"0", "pager2Event":"click", "pager2SlideHide":"0", "slideText":"1", "slideTextjQuery":"0", "slideTextPosition":"bottom", "slideTextContainer":"div.slide-text", "slideTextEffectBefore":"fadeOut", "slideTextEffectBeforeSpeed":"250", "slideTextEffectBeforeEasing":"linear", "slideTextEffectAfter":"fadeIn", "slideTextEffectAfterSpeed":"1000", "slideTextEffectAfterEasing":"linear", "height":"0", "width":"0"}}, "googleanalytics":{"trackOutbound":1, "trackMailto":1, "trackDownload":1, "trackDownloadExtensions":"7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip"}, "beautytips":{"calendar-tooltips":{"fill":"#F4F4F4", "strokeStyle":"#666666", "spikeLength":20, "spikeGirth":10, "width":350, "overlap":0, "centerPointY":1, "cornerRadius":0, "cssStyles":{"fontFamily":"\u0026quot;Lucida Grande\u0026quot;,Helvetica,Arial,Verdana,sans-serif", "fontSize":"12px", "padding":"10px 14px"}, "shadow":1, "shadowColor":"rgba(0,0,0,.5)", "shadowBlur":8, "shadowOffsetX":4, "shadowOffsetY":4, "cssSelect":".calendar-calendar .mini-day-on a, .calendar-calendar .day a", "contentSelector":"$(this).next().html()", "trigger":[ "mouseover", "mouseout" ], "list":[ "fill", "strokeStyle", "spikeLength", "spikeGirth", "width", "overlap", "centerPointY", "cornerRadius", "cssStyles", "shadow", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "contentSelector", "trigger" ]}}, "tableHeaderOffset":"Drupal.toolbar.height"});
//--><!]]>
</script>
Comments
If/when you turn on CSS and
If/when you turn on CSS and JS aggregation, it will get smaller.
Contact me to contract me for D7 -> D10/11 migrations.
drupal.org is how to do it?
thankyou,but ,
drupal.org is how to do it?
You are worrying
You are worrying unnecessarily. All the values passed are necessary and are used by the various javascript scripts running on your site. If you remove them, your scripts will fail, often shutting down every script on your page rendering your javascript useless.
Drupal.org is run on D6, while the example you showed is D7. This is part of the difference. Drupal.org also seems to be designed to be as lightweight as possible, so they aren't using a lot of fancy script functionality. In fact, the example you showed only seems to be using two modules that output javascript settings - google analytics, and whatever module is doing HTML5 Geolocation.
Contact me to contract me for D7 -> D10/11 migrations.
Clean html and js code, often is a customer favorite.
Clean html and js code, often is a customer favorite.
That is very clean code. It's
That is very clean code. It's a properly formed JSON structure.
Contact me to contract me for D7 -> D10/11 migrations.
jQuery.extend (Drupal.settings
jQuery.extend (Drupal.settings embedded js code, the best way is to remove from segment, into the bottom of the , but the js function of certain modules can not be performed, we can only <? phpprint $ scripts;?> put <? php print $ page_bottom;?> above, so we have a strange html code structure.
jQuery.extend (Drupal.settings
jQuery.extend (Drupal.settings embedded js code, the best way is to remove from segment, into the bottom of the , but the js function of certain modules can not be performed, we can only <? phpprint $ scripts;?> put <? php print $ page_bottom;?> above, so we have a strange html code structure.
code
I have no idea what you are
I have no idea what you are trying to ask.
Contact me to contract me for D7 -> D10/11 migrations.
A related question
The basepath in this script for me is "basePath":"\/"
I want to be able to change it to "basePath":"http:\/\/xyz.abc.com"
Can this be done?
It does not take the value from $base_url from setting.php, so apparently there should be some other flag that controls this value.
Thanks in advance