Javascript工具栏

Javascript工具栏,javascript,html,Javascript,Html,我正在将javascript工具栏调整为Joomla CMS模块。这个javascript工具栏有许多按钮,每个按钮调用一个javascript文件(插件) 当前工具栏是在Javascript上完成的 这是加载工具栏的代码 调用工具栏及其插件的初始代码 "undefined"==typeof window.AtKit?(d=document,jf=d.createElement("script"),jf.src="http://domain.com/jw3c/atkit.min.js",jf.t

我正在将javascript工具栏调整为Joomla CMS模块。这个javascript工具栏有许多按钮,每个按钮调用一个javascript文件(插件) 当前工具栏是在Javascript上完成的

这是加载工具栏的代码

调用工具栏及其插件的初始代码

"undefined"==typeof window.AtKit?(d=document,jf=d.createElement("script"),jf.src="http://domain.com/jw3c/atkit.min.js",jf.type="text/javascript",jf.id="AtKitLib",d.getElementsByTagName("head")[0].appendChild(jf),window.AtKitLoaded=function(){var c=null;this.subscribe=function(b){c=b};this.fire=function(b,e){null!=c&&c(b,e)}},window.AtKitLoaded=new AtKitLoaded,window.AtKitLoaded.subscribe(function(){__start()})):__start();
function __start(){var c=window,b=AtKit;$lib=b.lib();var e="ftw resize fonts spellng dictionary insipio-tts readability wordprediction css overlay shortcutkeys tooltip".split(" ");b.importPlugins(e,function(){b.setLogo("http://domain.com/services/logo.jpg");b.setName("JW3C");"undefined"==typeof c.AtKitLanguage?b.setLanguage("en"):b.setLanguage(c.AtKitLanguage);var a;a="Version 1.0.0<p style=\"line-height:120%\">Created by <a href='http://domain.com'>S</a>, <a href='http://www.domain.my/'></a>.<br><br>";
a+="Fugue Icons &copy; <a href='http://www.pinvoke.com'>pinvoke</a> under Creative Commons licence.<br>";a+="Dictionary &copy; <a href='http://en.wiktionary.org'>Wiktionary</a> under Creative Commons licence.<br>";a+="<a href='http://famspam.com/facebox/'>Facebox</a> jQuery plugin &copy; Chris Wanstrath under MIT licence<br>";a+='Portions of the spelling engine &copy; <a href="http://brandonaaron.net">Brandon Aaron</a> under MIT licence.<br>';a+="Word prediction provided by <a href='http://www.aitype.com/'>AIType</a>.<br>";
a+="Text-to-Speech provided by <a href='http://www.acapela-group.com/'>Acapela Group</a>.";a+="</p>";b.setAbout(a);$lib.each(e,function(a,c){b.addPlugin(c)});b.addResetFn("reset-saved",function(){b.clearStorage();null!=typeof localStorage&&localStorage.removeItem("ATBarAutoLoad")});b.addCloseFn("close-saved",function(){null!=typeof localStorage&&localStorage.removeItem("ATBarAutoLoad")});b.render();$lib(".at-btn:first a").focus();null!=typeof localStorage&&localStorage.setItem("ATBarAutoLoad",1)})}
;
“undefined”==typeof window.AtKit?(d=document,jf=d.createElement(“脚本”),jf.src=”http://domain.com/jw3c/atkit.min.js,jf.type=“text/javascript”,jf.id=“AtKitLib”,d.getElementsByTagName(“head”)[0]。appendChild(jf),window.atkitload=function(){var c=null;this.subscribe=function(b){c=b};this.fire=function(b,e){null!=c&&c(b,e)},window.atkitload=new-atkitload,window.atkitload.subscribe(函数(){{uu start()})):\uu start();
函数_ustart(){var c=window,b=AtKit;$lib=b.lib();var e=“ftw resize fonts Spelling dictionary Inspio tts readability wordprediction css overlay shortcutkeys tooltip.”拆分(“”);b.importPlugins(e,函数(){b.setLogo(“”)http://domain.com/services/logo.jpg);b.setName(“JW3C”);“undefined”==c.AtKitLanguage的类型?b.setLanguage(“en”):b.setLanguage(c.AtKitLanguage);var a;a=“1.0.0版

由创建人创建; a+=“Fugue Icons©;”在知识共享许可证下。
;a+=“Dictionary©;”在知识共享许可证下。
;a+=“jQuery plugin©;”Chris Wanstrath在麻省理工许可证下。
;a+=“拼写引擎部分©;”在麻省理工许可证下。
;a+=“单词预测由提供。
”; a+=“文本到语音由提供。”.a+=“

”;b.setAbout(a);$lib.each(e,function(a,c){b.addPlugin(c)});b.addResetFn(“reset saved”,function(){b.clearStorage();null!=localStorage类型和localStorage.removietem(“ATBarAutoLoad”);b.addCloseFn(“closesaved”,function(){null!=localStorage类型和localStorage.removietem(“ATBarAutoLoad”);b.render();$lib(“.at btn:first a”).focus();null!=typeof localStorage&&localStorage.setItem(“ATBarAutoLoad”,1)}) ;
工具栏的完整javascript:

上面代码中的一个javascript按钮调用工具栏中包含的以下插件。

根据上面的代码,工具栏显示在我的站点顶部,包含所有插件(javascript文件)。 现在我不想让工具栏调用自己,但需要将这些工具栏插件的每一项嵌入到我下面的php文件中

    <div id="samsc-<?php echo $module->id?>" class="samsc <?php echo $css; ?>">
    <div class="inner normal-msg">
        <?php echo $text; ?> 
//Need add javascript buttons here
        </div>
    <div class="buttons">
        <span class="icon-toogle opened"><?php echo JText::_('TOGGLE_BAR'); ?></span>
    </div>
</div>

您最好查看代码的非精简版本,看看它是如何工作的。
这里似乎有一个:

我想你应该看看第94行,因为“position:fixed”就是将条固定到页面顶部的东西

我猜第387行的意思是,它应该在开头的body标记旁边呈现html


如果您不想直接编辑此代码,那么在加载后使用css和javascript修改栏的显示可能会更简单(尽管更笨重)。例如,onload可以去掉“position:fixed”设置并更改左侧和顶部值的样式,以匹配模块的左侧和顶部值。

谢谢。我是否可以在php中调用此JS文件,然后调用php上的特定按钮,而不是加载整个工具栏?看起来工具栏并不是专为定制的开箱即用样式而设计的(理想情况下,它们允许您只发送不同版本的参数).我认为你必须破解代码才能让它以这种方式工作-我认为第387行可以更改,使代码显示在你自己的div中。需要进一步注意的是,他们在过去几年似乎已经停止更新此工具栏,而他们的wiki现在正在404中。你可能会更好地寻找你拥有的功能在其他地方使用ant并对其进行单独编码,而不是依赖此栏的所有功能继续工作。字体大小增加之类的脚本应该很容易找到。谢谢…是的。我找到了几个脚本,但屏幕阅读器除外…这就是我坚持使用此栏的原因。