本文整理汇总了PHP中N2JS::addFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP N2JS::addFiles方法的具体用法?PHP N2JS::addFiles怎么用?PHP N2JS::addFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类N2JS
的用法示例。
在下文中一共展示了N2JS::addFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderType
protected function renderType()
{
$params = $this->slider->params;
N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("MainAnimationSimple.js", "TypeSimple.js", "ResponsiveSimple.js"), "smartslider-simple-type-frontend");
N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("BackgroundAnimation.js"), "smartslider-simple-type-frontend");
N2JS::addFiles(NEXTEND_SMARTSLIDER_ASSETS . "/js/animation", array("BackgroundAnimationAbstract.js", 'Flux.js'), "smartslider-simple-type-frontend");
$background = $params->get('background');
$css = $params->get('slider-css');
$slidecss = $params->get('slide-css');
if (!empty($background)) {
$css = 'background-image: url(' . N2ImageHelper::fixed($background) . ');';
}
$this->initBackgroundAnimation();
echo $this->openSliderElement();
?>
<div class="n2-ss-slider-1" style="<?php
echo $css;
?>
">
<?php
echo $this->getBackgroundVideo($params);
?>
<div class="n2-ss-slider-2">
<?php
if ($this->backgroundAnimation) {
?>
<div class="n2-ss-background-animation"></div>
<?php
}
?>
<div class="n2-ss-slider-3" style="<?php
echo $slidecss;
?>
">
<?php
echo $this->slider->staticHtml;
foreach ($this->slider->slides as $i => $slide) {
echo N2Html::tag('div', $slide->attributes + array('class' => 'n2-ss-slide n2-ss-canvas ' . $slide->classes, 'style' => $slide->style), $slide->background . $slide->getHTML());
}
?>
</div>
</div>
</div>
<?php
$this->widgets->echoRemainder();
echo N2Html::closeTag('div');
$this->javaScriptProperties['mainanimation'] = array('type' => $params->get('animation'), 'duration' => intval($params->get('animation-duration')), 'delay' => intval($params->get('animation-delay')), 'ease' => $params->get('animation-easing'), 'parallax' => floatval($params->get('animation-parallax')), 'shiftedBackgroundAnimation' => $params->get('animation-shifted-background-animation'));
$this->javaScriptProperties['mainanimation']['shiftedBackgroundAnimation'] = 0;
$this->javaScriptProperties['carousel'] = intval($params->get('carousel'));
$this->javaScriptProperties['dynamicHeight'] = intval($params->get('dynamic-height', '0'));
$this->javaScriptProperties['dynamicHeight'] = 0;
N2Plugin::callPlugin('nextendslider', 'onNextendSliderProperties', array(&$this->javaScriptProperties));
N2JS::addFirstCode("new NextendSmartSliderSimple('#{$this->slider->elementId}', " . json_encode($this->javaScriptProperties) . ");");
echo N2Html::clear();
}
示例2: assetsBackend
public function assetsBackend()
{
$path = $this->getAssetsPath();
N2JS::addFiles($path . "/admin/js", array("visual.js", "modals.js", "sets.js", "visualeditor.js"), 'system-backend');
foreach (glob($path . "/admin/js/*.js") as $file) {
N2JS::addFile($file, 'system-backend');
}
foreach (glob($path . "/admin/js/fontservices/*.js") as $file) {
N2JS::addFile($file, 'system-backend');
}
}
示例3: loadFonts
public function loadFonts()
{
$familyQuery = array();
if (count($this->files)) {
foreach ($this->files as $family => $styles) {
if (count($styles)) {
$familyQuery[] = $family . ':' . implode(',', $styles);
}
}
}
if (empty($familyQuery)) {
return false;
}
$subsets = array_unique($this->inline);
$familyQuery[count($familyQuery) - 1] .= ':' . implode(',', $subsets);
N2JS::addFiles(N2LIBRARYASSETS . "/js", array('webfontloader.js'), 'nextend-webfontloader');
N2JS::addInline("\r\n nextend.fontsLoaded = false;\r\n nextend.fontsLoadedActive = function () {nextend.fontsLoaded = true;};\r\n var fontData = {\r\n google: {\r\n families: " . json_encode($familyQuery) . "\r\n },\r\n active: function(){nextend.fontsLoadedActive()},\r\n inactive: function(){nextend.fontsLoadedActive()}\r\n };\r\n if(typeof WebFont === 'undefined'){\r\n window.WebFontConfig = fontData;\r\n }else{\r\n WebFont.load(fontData);\r\n }", true);
N2JS::addFirstCode("\r\n nextend.fontsDeferred = n2.Deferred();\r\n if(nextend.fontsLoaded){\r\n nextend.fontsDeferred.resolve();\r\n }else{\r\n nextend.fontsLoadedActive = function () {\r\n nextend.fontsLoaded = true;\r\n nextend.fontsDeferred.resolve();\r\n };\r\n }", true);
}
示例4: custom_animation_framework
public static function custom_animation_framework()
{
N2JS::addFiles(N2LIBRARYASSETS . "/js/core/n2timeline", array("array.js", "raf.js", "animation.js", "css.js", "tween.js", "timeline.js", "easing.js"), "nextend-frontend");
}