function ac_gallery_get_upload_meta_data()
{
    $plupload_init = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'plupload-browse-button', 'container' => 'plupload-upload-ui', 'drop_element' => 'drag-drop-area', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files', 'alleycat'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multipart_params' => array('_ajax_nonce' => wp_create_nonce('photo-upload'), 'action' => 'photo_gallery_upload'));
    // Get the data values
    $plupload_init = apply_filters('plupload_init', $plupload_init);
    return $plupload_init;
}
 /**
  * Load JS and CSS need for admin features.
  *
  */
 function initStyleScript($hook_sufix)
 {
     global $taxonomy;
     if ($hook_sufix == 'edit-tags.php') {
         if ($taxonomy != $this->taxo->name) {
             return false;
         }
         foreach ($this->sidebars_fields as $name => $sidebar) {
             if ($name == 'cf_inactive_fields' || empty($sidebar) || !is_array($sidebar)) {
                 continue;
             }
             foreach ($sidebar as $widget) {
                 $idbase = $this->cf_registered_fields[$widget]['classname'];
                 // Allow composant to add JS/CSS
                 do_action('cf-fields-scriptstyles-' . $idbase);
             }
         }
         $this->_editTags = true;
         // Add CSS for boxes
         wp_enqueue_style('simple-custom-types-object', SCF_URL . '/inc/css/admin.css', array(), SCF_VERSION);
         wp_enqueue_script("tiny_mce", includes_url('js/tinymce') . '/tiny_mce.js');
         return true;
     }
     return false;
 }
Example #3
0
function html5press_register_scripts()
{
    /**
     * Modernizr enables HTML5 elements & feature detects
     * For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
     */
    wp_enqueue_script('modernizr', get_stylesheet_directory_uri() . '/js/modernizr-2.0.6.min.js', '', '2.0.6');
    // Make sure jQuery is loaded after Modernizr
    wp_deregister_script('jquery');
    wp_enqueue_script('jquery', includes_url('js/jquery/jquery.js'), array('modernizr'), null);
    wp_enqueue_script('easing', get_stylesheet_directory_uri() . '/js/easing.min.js', array('jquery'), '1.1.2', true);
    global $html5press_options;
    $html5press_settings = get_option('html5press_options', $html5press_options);
    // If back to top is enabled, add easing and the back to top javascript.
    if ($html5press_settings['back_to_top'] == 1) {
        wp_enqueue_script('totop', get_stylesheet_directory_uri() . '/js/jquery.ui.totop.js', array('jquery'), '1.1', true);
    }
    if ($html5press_settings['enable_slimbox'] == 1) {
        wp_enqueue_script('slimbox2', get_stylesheet_directory_uri() . '/js/slimbox2.js', array('jquery'), '2.04', true);
    }
    if (!empty($html5press_settings['featured_cat'])) {
        wp_enqueue_script('bxslider', get_stylesheet_directory_uri() . '/js/jquery.bxSlider.min.js', array('jquery'), '3.0', true);
        wp_enqueue_script('bxslider-load', get_stylesheet_directory_uri() . '/js/bxslider-load.js', array('bxslider'), '1.0', true);
    }
    if ($html5press_settings['fuzzy_timestamps'] == 1) {
        wp_enqueue_script('timeago', get_stylesheet_directory_uri() . '/js/jquery.timeago.js', array('jquery'), '0.9.3', true);
    }
}
Example #4
0
 /**
  * Returns an array that holds the field data, suitable for JSON representation.
  * This data will be available in the Underscore template and the Backbone Model.
  *
  * @param bool $load  Should the value be loaded from the database or use the value from the current instance.
  * @return array
  */
 public function to_json($load)
 {
     $field_data = parent::to_json($load);
     $url = '';
     $thumb_url = '';
     $default_thumb_url = includes_url('/images/media/default.png');
     $file_ext = '';
     $file_type = '';
     $value = $this->get_value();
     if ($value) {
         $url = is_numeric($value) ? wp_get_attachment_url($value) : $value;
         $filetype = wp_check_filetype($url);
         $file_ext = $filetype['ext'];
         // png, mp3, etc..
         $file_type = preg_replace('~\\/.+$~', '', $filetype['type']);
         // image, video, etc..
         if ($file_type == 'image') {
             $thumb_url = $url;
             if ($this->value_type == 'id') {
                 $thumb_src = wp_get_attachment_image_src($value, 'thumbnail');
                 $thumb_url = $thumb_src[0];
             }
         } else {
             $thumb_url = $default_thumb_url;
         }
     }
     $field_data = array_merge($field_data, array('url' => (string) $url, 'thumb_url' => $thumb_url, 'default_thumb_url' => $default_thumb_url, 'file_ext' => $file_ext, 'file_type' => $file_type, 'button_label' => $this->button_label, 'window_button_label' => $this->window_button_label, 'window_label' => $this->window_label, 'type_filter' => $this->field_type, 'value_type' => $this->value_type));
     return $field_data;
 }
Example #5
0
function amr_ical_support_links()
{
    echo '<div class="postbox" style="padding:1em 2em; width: 600px;">
	<p>
	<a href="http://icalevents.com/documentation" title="documentation for amr-ical-events-list and amr-events">';
    _e('Documentation', 'amr-ical-events-list');
    echo '</a>&nbsp;&nbsp;
	<a href="http://icalevents.com/support/" title="Support Forum">';
    _e('Support', 'amr-ical-events-list');
    /*	echo '</a>&nbsp;&nbsp;
    	<a href="http://icalevents.com/videos" title="Events plugin videos">';
    	_e('Videos', 'amr-ical-events-list');
    	*/
    echo '</a>&nbsp;&nbsp;
	<a href="https://wordpress.org/support/plugin/amr-ical-events-list" title="If you like it rate it...">';
    _e('Rate or Review', 'amr-ical-events-list');
    echo '</a>&nbsp;&nbsp;<a href="http://icalevents.com/feed/">';
    _e('Plugin feed', 'amr-ical-events-list');
    echo '</a>&nbsp;<img src="';
    echo includes_url();
    echo 'images/rss.png" alt="Rss icon" style="vertical-align:middle;" />';
    /*echo '&nbsp;&nbsp;
    	<a href="http://icalevents.com/forums/feed">';
    	_e('Forum feed', 'amr-ical-events-list');
    	echo '</a>&nbsp;<img src="';
    	echo includes_url(); 
    	echo 'images/rss.png" alt="Rss icon" style="vertical-align:middle;" />';*/
    echo '</p>';
    echo '</div>';
}
Example #6
0
 public static function get_preview_from_url($url)
 {
     $preview = '';
     $images = array('jpg', 'jpeg', 'bmp', 'gif', 'png');
     if (filter_var($url, FILTER_VALIDATE_URL) !== FALSE) {
         // check for extension, if it has extension then use it
         $info = pathinfo($url);
         if (isset($info['extension'])) {
             if (in_array($info['extension'], $images)) {
                 $preview = $url;
             } else {
                 $type = wp_ext2type($info['extension']);
                 if (is_null($type)) {
                     $type = 'default';
                 }
                 $preview = includes_url() . 'images/crystal/' . $type . '.png';
             }
         } else {
             // if no extension, try to discover from mime
             $mime = wp_remote_head($url);
             if (!is_wp_error($mime)) {
                 $mime = $mime['headers']['content-type'];
                 if (strpos($mime, 'image') === 0) {
                     $preview = $url;
                 } else {
                     $preview = wp_mime_type_icon($mime);
                 }
             } else {
                 $preview = includes_url() . 'images/crystal/' . 'default' . '.png';
             }
         }
     }
     return $preview;
 }
function sz_google_ajax_load_scripts()
{
    wp_enqueue_style('sz-google-style-admin', plugin_dir_url(SZ_PLUGIN_GOOGLE_MAIN) . 'admin/files/css/sz-google-style-admin.css', array(), SZ_PLUGIN_GOOGLE_VERSION);
    wp_enqueue_script('sz-google-javascript-widgets', plugin_dir_url(SZ_PLUGIN_GOOGLE_MAIN) . 'admin/files/js/jquery.szgoogle.widgets.js', array('jquery'), SZ_PLUGIN_GOOGLE_VERSION, false);
    wp_enqueue_script('tiny_mce_popup', includes_url('js/tinymce/tiny_mce_popup.js'), array('jquery'), SZ_PLUGIN_GOOGLE_VERSION, false);
    wp_enqueue_script('tiny_mce_component', plugin_dir_url(SZ_PLUGIN_GOOGLE_MAIN) . 'admin/mce/js/' . SZGOOGLE_AJAX_NAME . '.js', array('tiny_mce_popup'), SZ_PLUGIN_GOOGLE_VERSION, false);
}
    public function test_wysiwyg_field()
    {
        global $wp_version;
        $this->field_test['fields'][0]['type'] = 'wysiwyg';
        $cmb = new CMB2($this->field_test);
        $field = cmb2_get_field($this->field_test['id'], 'field_test_field', $this->post_id);
        $this->assertInstanceOf('CMB2_Field', $field);
        $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
        $version = 'ver=' . $wp_version;
        $field_gen = '
		<div class="cmb-row cmb-type-wysiwyg cmb2-id-field-test-field">
			<div class="cmb-td">
				<label for="field_test_field">Name</label>
				<div id="wp-field_test_field-wrap" class="wp-core-ui wp-editor-wrap html-active">
					<link rel=\'stylesheet\' id=\'dashicons-css\' href=\'' . includes_url("css/dashicons{$suffix}.css?{$version}") . '\' type=\'text/css\' media=\'all\' />
					<link rel=\'stylesheet\' id=\'editor-buttons-css\' href=\'' . includes_url("css/editor{$suffix}.css?{$version}") . '\' type=\'text/css\' media=\'all\' />
					<div id="wp-field_test_field-editor-container" class="wp-editor-container">
						<textarea class="wp-editor-area" rows="20" cols="40" name="field_test_field" id="field_test_field">
						</textarea>
					</div>
				</div>
				<p class="cmb2-metabox-description">This is a description</p>
			</div>
		</div>
		';
        $this->assertEquals($this->clean_string($this->render_field($field)), $this->clean_string($field_gen));
    }
 function index_action($return = FALSE)
 {
     // If the site was accessed as http://foobar.com but the iframe/site_url() is http://www.foobar.com,
     // then the JS will generate cross origin framing errors
     if (isset($_GET['ngg_fix_cross_origins']) && isset($_SERVER['HTTP_REFERER'])) {
         $referrer = parse_url($_SERVER['HTTP_REFERER']);
         $host = parse_url(site_url());
         $referrer = $referrer['host'];
         $host = $host['host'];
         if ($host != $referrer) {
             $parts = explode('.', $host);
             $host = implode('.', array_slice($parts, -2, 2));
             if ($host == $referrer) {
                 header("X-Frame-Options: ALLOW-FROM {$host}");
             }
         }
     }
     $this->object->expires("1 year");
     // IMPORTANT: The Displayed Gallery has already been fetched by the
     // parent frame, and is available on the client side as
     // window.galleries.gallery_[id] and therefore fetching the
     // displayed gallery on the server side is strongly discouraged as it's
     // a redundant database query. Instead, find a way to make use of the
     // client side object
     $protect_images = !empty(C_NextGen_Settings::get_instance()->protect_images) ? TRUE : FALSE;
     return $this->object->render_view('photocrati-galleria#galleria_iframe', array('id' => $this->param('id'), 'jquery_url' => includes_url('/js/jquery/jquery.js'), 'galleria_url' => $this->get_static_url('photocrati-galleria#galleria-1.2.9.min.js'), 'galleria_instance_js' => $this->object->galleria_instance_js(), 'ngg_settings' => array('protect_images' => $protect_images)), $return);
 }
 /**
  * constructeur
  */
 public function __construct()
 {
     $this->_sPluginsURL = plugins_url();
     $this->_sIncludesURL = includes_url();
     // fonction de load js
     add_action('wp_print_scripts', array($this, 'loadJS'));
 }
Example #11
0
function et_fb_enqueue_assets()
{
    global $wp_version;
    et_fb_load_portability();
    $ver = ET_BUILDER_VERSION;
    $root = ET_BUILDER_URI;
    $app = ET_FB_URI;
    $assets = ET_FB_ASSETS_URI;
    // Get WP major version
    $wp_major_version = substr($wp_version, 0, 3);
    // Register styles.
    // wp_enqueue_style( 'et-frontend-builder', "{$assets}/css/frontend-builder.css", null, $ver );
    // Register scripts.
    // wp_register_script( 'minicolors', "{$root}/scripts/ext/jquery.minicolors.js" );
    wp_register_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false, 1);
    wp_register_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false, 1);
    wp_register_script('wp-color-picker-alpha', "{$root}/scripts/ext/wp-color-picker-alpha.min.js", array('wp-color-picker'));
    $colorpicker_l10n = array('clear' => esc_html__('Clear', 'et_builder'), 'defaultString' => esc_html__('Default', 'et_builder'), 'pick' => esc_html__('Select Color', 'et_builder'), 'current' => esc_html__('Current Color', 'et_builder'));
    wp_localize_script('wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n);
    wp_register_script('react-tiny-mce', "{$assets}/vendors/tinymce.min.js");
    if (version_compare($wp_major_version, '4.5', '<')) {
        wp_register_script('et_pb_admin_date_js', "{$root}/scripts/ext/jquery-ui-1.10.4.custom.min.js", array('jquery'), $ver, true);
    } else {
        wp_register_script('et_pb_admin_date_js', "{$root}/scripts/ext/jquery-ui-1.11.4.custom.min.js", array('jquery'), $ver, true);
    }
    wp_register_script('et_pb_admin_date_addon_js', "{$root}/scripts/ext/jquery-ui-timepicker-addon.js", array('et_pb_admin_date_js'), $ver, true);
    wp_register_script('wp-shortcode', includes_url() . '/js/shortcode.js', array(), $wp_version);
    $fb_bundle_dependencies = apply_filters('et_fb_bundle_dependencies', array('jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-resizable', 'underscore', 'jquery-ui-sortable', 'jquery-effects-core', 'iris', 'wp-color-picker', 'wp-color-picker-alpha', 'react-tiny-mce', 'easypiechart', 'et_pb_admin_date_addon_js', 'salvattore', 'hashchange', 'wp-shortcode'));
    // Enqueue scripts.
    wp_enqueue_script('et-frontend-builder', "{$app}/bundle.js", $fb_bundle_dependencies, $ver, true);
    // Enqueue failure notice script.
    wp_enqueue_script('et-frontend-builder-failure', "{$assets}/scripts/failure_notice.js", array(), $ver, true);
    wp_localize_script('et-frontend-builder-failure', 'et_fb_options', array('ajaxurl' => admin_url('admin-ajax.php'), 'et_admin_load_nonce' => wp_create_nonce('et_admin_load_nonce'), 'memory_limit_increased' => esc_html__('Your memory limit has been increased', 'et_builder'), 'memory_limit_not_increased' => esc_html__("Your memory limit can't be changed automatically", 'et_builder')));
    do_action('et_fb_enqueue_assets');
}
 function enqueue_image_editor_scripts()
 {
     $suffix = function_exists('rtm_get_script_style_suffix') ? rtm_get_script_style_suffix() : '.min';
     wp_enqueue_script('wp-ajax-response');
     wp_enqueue_script('rtmedia-image-edit', admin_url("js/image-edit{$suffix}.js"), array('jquery', 'json2', 'imgareaselect'), false, 1);
     wp_enqueue_style('rtmedia-image-area-select', includes_url('/js/imgareaselect/imgareaselect.css'));
 }
Example #13
0
/**
* Load theme scripts in the footer
*
* Big thanks to Chris Ferdinandi on this one!
* ref: http://gomakethings.com/inlining-critical-css-for-better-web-performance/
*/
function _tcg_load_theme_files()
{
    // If stylesheet is in browser cache, load it the traditional way
    // Otherwise, inline critical CSS and load full stylesheet asynchronously
    // See _tcg_initialize_theme_detects()
    // Load theme fonts
    wp_enqueue_style('_tcg-fonts', '//fonts.googleapis.com/css?family=Poiret+One');
    // Load comment script from origina _s
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Re-enable & test this if browser paint delays
    if (isset($_COOKIE['fullCSS']) && $_COOKIE['fullCSS'] === 'true') {
        wp_enqueue_style('_tcg-theme-styles', get_template_directory_uri() . '/style.css', null, null, 'all');
    }
    // Move jquery to the footer
    // it's being defer'd instead of async'd - move to header and load renderblocking in case of bugginess
    // get rid of jquery-migrate cause we're too cocky and smart for that shit.
    wp_deregister_script('jquery');
    wp_dequeue_script('jquery');
    wp_register_script('jquery-core', includes_url('/js/jquery/jquery.js'), false, NULL, true);
    wp_enqueue_script('jquery-core');
    // Add dependency to jquery-core for Asset Queue Manager, DO NOT load in footer or aqm fails
    wp_register_script('asset-queue-manager', '/wp-content/plugins/asset-queue-manager/assets/js/aqm.min.js', 'jquery-core', NULL, false);
    // Apparently enqueueing isn't necessary, may want to research this more
    // wp_enqueue_script( 'asset-queue-manager' );
    wp_register_script('_tcg-theme-scripts', get_template_directory_uri() . '/js/main.min.js', 'jquery-core', null, true);
    wp_enqueue_script('_tcg-theme-scripts');
}
function tshirt_designer_init_scripts()
{
    $tshirt_designer_sticker_size = get_option('tshirt_designer_sticker_size');
    if (empty($tshirt_designer_sticker_size)) {
        $tshirt_designer_sticker_size = intval(2 * 1000 * 1000);
    } else {
        $tshirt_designer_sticker_size = intval($tshirt_designer_sticker_size * 1000 * 1000);
    }
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-widget');
    wp_enqueue_script('jquery-ui-mouse');
    wp_enqueue_script('jquery-ui-draggable');
    wp_enqueue_script('jquery-ui-resizable');
    wp_enqueue_style('jquery-ui.css', tshirt_designer_plugin_url . 'css/jquery-ui.css');
    wp_enqueue_script('html2canvas.js', plugins_url('/js/html2canvas.js', __FILE__), array('jquery'), '1.0', false);
    //wp_enqueue_script( 'circletype.js', plugins_url( '/js/circletype.js', __FILE__ ), array('jquery'), '1.0', false);
    wp_enqueue_script('jscolor.js', plugins_url('/js/jscolor.js', __FILE__), array('jquery'), '1.0', false);
    wp_enqueue_script('tshirt_designer_js', plugins_url('/js/scripts.js', __FILE__), array('jquery'));
    wp_localize_script('tshirt_designer_js', 'tshirt_designer_ajax', array('tshirt_designer_ajaxurl' => admin_url('admin-ajax.php')));
    wp_enqueue_style('tshirt_designer_style', tshirt_designer_plugin_url . 'css/style.css');
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('tshirt_designer_color_picker', plugins_url('/js/color-picker.js', __FILE__), false, true);
    //ParaAdmin
    wp_enqueue_style('ParaAdmin', tshirt_designer_plugin_url . 'ParaAdmin/css/ParaAdmin.css');
    //wp_enqueue_style('ParaDashboard', tshirt_designer_plugin_url.'ParaAdmin/css/ParaDashboard.css');
    //wp_enqueue_style('ParaIcons', tshirt_designer_plugin_url.'ParaAdmin/css/ParaIcons.css');
    wp_enqueue_script('ParaAdmin', plugins_url('ParaAdmin/js/ParaAdmin.js', __FILE__), array('jquery'));
    wp_enqueue_script('plupload-handlers');
    wp_enqueue_script('sticker_upload', tshirt_designer_plugin_url . 'js/upload-sticker.js', array('jquery'));
    wp_localize_script('sticker_upload', 'sticker_upload', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('sticker_upload'), 'remove' => wp_create_nonce('sticker_remove'), 'number' => 5, 'upload_enabled' => true, 'confirmMsg' => __('Are you sure you want to delete this?'), 'plupload' => array('runtimes' => 'html5,flash,html4', 'browse_button' => 'sticker-uploader', 'container' => 'sticker-upload-container', 'file_data_name' => 'sticker_upload_file', 'max_file_size' => $tshirt_designer_sticker_size . 'b', 'url' => admin_url('admin-ajax.php') . '?action=sticker_upload&nonce=' . wp_create_nonce('sticker_allow'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => 'gif,png')), 'multipart' => true, 'urlstream_upload' => true)));
}
 static function register_scripts()
 {
     if (!wp_script_is('plupload-all')) {
         wp_enqueue_script('plupload-all');
     }
     wp_enqueue_script('rtmedia-backbone', RTMEDIA_URL . 'app/assets/js/rtMedia.backbone.js', array('plupload-all', 'backbone'), false, true);
     if (is_rtmedia_album_gallery()) {
         $template_url = esc_url(add_query_arg(array("action" => 'rtmedia_get_template', "template" => "album-gallery-item"), admin_url("admin-ajax.php")), null, '');
     } else {
         $template_url = esc_url(add_query_arg(array("action" => 'rtmedia_get_template', "template" => apply_filters('rtmedia_backbone_template_filter', "media-gallery-item")), admin_url("admin-ajax.php")), null, '');
     }
     wp_localize_script('rtmedia-backbone', 'template_url', $template_url);
     $url = trailingslashit($_SERVER["REQUEST_URI"]);
     $rtmedia_slug = "/" . RTMEDIA_MEDIA_SLUG;
     // check position of media slug from end of the URL
     if (strrpos($url, $rtmedia_slug) !== false) {
         // split the url upto the last occurance of media slug
         $url_upload = substr($url, 0, strrpos($url, $rtmedia_slug));
         $url = trailingslashit($url_upload) . "upload/";
     } else {
         $url = trailingslashit($url) . "upload/";
     }
     $params = array('url' => $url, 'runtimes' => 'html5,flash,html4', 'browse_button' => 'rtMedia-upload-button', 'container' => 'rtmedia-upload-container', 'drop_element' => 'drag-drop-area', 'filters' => apply_filters('rtmedia_plupload_files_filter', array(array('title' => "Media Files", 'extensions' => get_rtmedia_allowed_upload_type()))), 'max_file_size' => min(array(ini_get('upload_max_filesize'), ini_get('post_max_size'))), 'multipart' => true, 'urlstream_upload' => true, 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'file_data_name' => 'rtmedia_file', 'multi_selection' => true, 'multipart_params' => apply_filters('rtmedia-multi-params', array('redirect' => 'no', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER['REQUEST_URI'], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator(false, true))), 'max_file_size_msg' => apply_filters("rtmedia_plupload_file_size_msg", min(array(ini_get('upload_max_filesize'), ini_get('post_max_size')))));
     if (wp_is_mobile()) {
         $params['multi_selection'] = false;
     }
     $params = apply_filters("rtmedia_modify_upload_params", $params);
     wp_localize_script('rtmedia-backbone', 'rtMedia_plupload_config', $params);
     wp_localize_script('rtmedia-backbone', 'rMedia_loading_file', admin_url("/images/loading.gif"));
 }
 protected function __output()
 {
     $num = $this->property['num_posts'] ? $this->property['num_posts'] : 4;
     $url = $this->property['url'];
     while (stristr($url, 'http') != $url) {
         $url = substr($url, 1);
     }
     if (empty($url)) {
         return;
     }
     $rss = fetch_feed($url);
     $desc = '';
     $link = '';
     if (!is_wp_error($rss)) {
         $desc = esc_attr(strip_tags(@html_entity_decode($rss->get_description(), ENT_QUOTES, get_option('blog_charset'))));
         if (empty($title)) {
             $title = esc_html(strip_tags($rss->get_title()));
         }
         $link = esc_url(strip_tags($rss->get_permalink()));
         while (stristr($link, 'http') != $link) {
             $link = substr($link, 1);
         }
     }
     $icon = includes_url('images/rss.png');
     if ($title) {
         $title = "<a class='rsswidget' href='{$url}' title='" . esc_attr__('Assinar feed', 'tnb') . "'><img style='border:0' width='14' height='14' src='{$icon}' alt='RSS' /></a> <a class='rsswidget' href='{$link}' title='{$desc}'>{$title}</a>";
     }
     echo $title;
     $show_author = $this->property['exibir_autor'] == 1 ? 1 : 0;
     $show_date = $this->property['exibir_data'] == 1 ? 1 : 0;
     $show_summary = $this->property['exibir_resumo'] == 1 ? 1 : 0;
     $items = $this->property['num_posts'] ? $this->property['num_posts'] : 5;
     $default_args = array('show_author' => $show_author, 'show_date' => $show_date, 'show_summary' => $show_summary, 'items' => $items);
     wp_widget_rss_output($rss, $default_args);
 }
 public function print_scripts()
 {
     if (!isset($_REQUEST['page'])) {
         return;
     }
     $this->add_existed_script('jquery');
     $this->add_existed_script('plupload');
     //add de sort category
     $this->add_existed_script('jquery-ui-sortable');
     $this->add_script('lib-nested-sortable', ae_get_url() . '/assets/js/jquery.nestedSortable.js', array('jquery', 'jquery-ui-sortable'));
     // tam thoi add de xai
     $this->add_script('jquery-validator', ae_get_url() . '/assets/js/jquery.validate.min.js', 'jquery');
     $this->add_script('ae-colorpicker', ae_get_url() . '/assets/js/colorpicker.js', array('jquery'));
     $this->add_script('marionette', ae_get_url() . '/assets/js/marionette.js', array('jquery', 'underscore', 'backbone'));
     // control backend user list
     $this->add_script('gmap', ae_get_url() . '/assets/js/gmap.js', array('et-googlemap-api'));
     // ae core js appengine
     $this->add_script('appengine', ae_get_url() . '/assets/js/appengine.js', array('jquery', 'underscore', 'backbone', 'marionette', 'plupload', 'ae-colorpicker'));
     // control backend user list
     $this->add_script('backend-user', ae_get_url() . '/assets/js/user-list.js', array('appengine'));
     // control backend order list
     $this->add_script('order-list', ae_get_url() . '/assets/js/payment-list.js', array('appengine'));
     //  option settings and save
     $this->add_script('option-view', ae_get_url() . '/assets/js/option-view.js', array('appengine'));
     // control option translate
     $this->add_script('language-view', ae_get_url() . '/assets/js/language-view.js', array('appengine', 'option-view'));
     // control pack view add delete update pack
     $this->add_script('pack-view', ae_get_url() . '/assets/js/pack-view.js', array('appengine', 'option-view'));
     // backend js it should be separate by theme
     $this->add_script('backend', ae_get_url() . '/assets/js/backend.js', array('appengine'));
     wp_localize_script('appengine', 'ae_globals', array('ajaxURL' => admin_url('admin-ajax.php'), 'imgURL' => ae_get_url() . '/assets/img/', 'jsURL' => ae_get_url() . '/assets/js/', 'themeImgURL' => get_template_directory_uri() . '/img/', 'loadingImg' => '<img class="loading loading-wheel" src="' . ae_get_url() . '/assets/img/loading.gif" alt="' . __('Loading...', 'aecore-class-ae-page-backend') . '">', 'loading' => __('Loading', 'aecore-class-ae-page-backend'), 'texts' => array('limit_category_level' => __("Categories' level is limited to 3", 'aecore-class-ae-page-backend')), 'ae_is_mobile' => et_load_mobile() ? 1 : 0, 'plupload_config' => array('max_file_size' => '3mb', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Image Files', 'aecore-class-ae-page-backend'), 'extensions' => 'jpg,jpeg,gif,png')))));
 }
 function load_scripts_and_styles()
 {
     if (is_admin()) {
         //Load any admin side scripts here
         //Album page
         if (strpos($_SERVER['QUERY_STRING'], 'page=wppg') !== false) {
             if ($_GET['page'] == 'wppg_album') {
                 //media upload stuff
                 wp_enqueue_script('media-upload');
                 wp_enqueue_script('thickbox');
                 wp_register_script('wppg-media-upload', WP_PHOTO_URL . '/js/wppg_album_thumb_uploader.js', array('jquery', 'media-upload', 'thickbox'));
                 wp_enqueue_style('dialogStylesheet', includes_url() . 'css/jquery-ui-dialog.css');
                 wp_enqueue_script('wppg-media-upload');
                 wp_enqueue_style('thickbox');
                 //style sheet for thickbox
             }
         }
     } else {
         //Load front end side scripts here
         wp_enqueue_style('wppg-photo-css', WP_PHOTO_URL . '/css/wppg-photo.css', null, WP_PHOTO_VERSION, 'all');
         wp_register_style('wppg-slider-custom-css', WP_PHOTO_URL . '/js/flexslider/flexslider-custom.css', null, WP_PHOTO_VERSION, 'all');
         wp_register_style('wppg-slider-css', WP_PHOTO_URL . '/js/flexslider/flexslider.css', null, WP_PHOTO_VERSION, 'all');
         wp_enqueue_script('jquery-lightbox', WP_PHOTO_URL . '/js/jquery-lightbox/js/jquery.lightbox-0.5.js', array('jquery'), WP_PHOTO_VERSION);
         wp_register_script('wppg-flex-slider', WP_PHOTO_URL . '/js/flexslider/jquery.flexslider-min.js', array('jquery'), WP_PHOTO_VERSION, true);
         //Load this script only for pages with the slider shortcode
         //wp_register_script('wppg-slider-related', WP_PHOTO_URL . '/js/wppg-slider-related.js', array('jquery'), WP_PHOTO_VERSION, true); //Load this script only for pages with the slider shortcode
     }
 }
 public function render($configuration)
 {
     $configuration = wp_parse_args($configuration, array('flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap')));
     $this->javascript->set('media-uploader-data', $configuration);
     $this->javascript->localize('media-uploader-strings', array('upload-restrictions-images-others-videos' => __('You can upload <images-left> images of up to <images-max-file-size> each, <videos-left> videos of up to <videos-max-file-size> each and <others-left> other files of up to <others-max-file-size> each.', 'AWPCP'), 'upload-restrictions-images-others' => __('You can upload <images-left> images of up to <images-max-file-size> each and <others-left> other files (no videos) of up to <others-max-file-size> each.', 'AWPCP'), 'upload-restrictions-images-videos' => __('You can upload <images-left> images of up to <images-max-file-size> each and <videos-left> videos of up to <videos-max-file-size> each.', 'AWPCP'), 'upload-restrictions-others-videos' => __('You can upload <videos-left> videos of up to <videos-max-file-size> each and <others-left> other files (no images) of up to <others-max-file-size> each.', 'AWPCP'), 'upload-restrictions-images' => __('You can upload <images-left> images of up to <images-max-file-size> each.', 'AWPCP'), 'upload-restrictions-others' => __('You can upload <others-left> files (no videos or images) of up to <others-max-file-size> each.', 'AWPCP'), 'upload-restrictions-videos' => __('You can upload <videos-left> videos of up to <videos-max-file-size> each.', 'AWPCP'), 'cannot-add-more-files' => $this->validation_errors->get_cannot_add_more_files_of_type_error_message(), 'file-is-too-large' => $this->validation_errors->get_file_is_too_large_error_message()));
     return $this->render_component();
 }
function js_wp_editor($settings = array())
{
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    $set = _WP_Editors::parse_settings('apid', $settings);
    if (!current_user_can('upload_files')) {
        $set['media_buttons'] = false;
    }
    if ($set['media_buttons']) {
        wp_enqueue_script('thickbox');
        wp_enqueue_style('thickbox');
        wp_enqueue_script('media-upload');
        $post = get_post();
        if (!$post && !empty($GLOBALS['post_ID'])) {
            $post = $GLOBALS['post_ID'];
        }
        wp_enqueue_media(array('post' => $post));
    }
    _WP_Editors::editor_settings('apid', $set);
    $ap_vars = array('url' => get_home_url(), 'includes_url' => includes_url());
    wp_register_script('ap_wpeditor_init', get_template_directory_uri() . '/functions/js-wp-editor.js', array('jquery'), '1.1', true);
    wp_localize_script('ap_wpeditor_init', 'ap_vars', $ap_vars);
    wp_enqueue_script('ap_wpeditor_init');
}
Example #21
0
 /**
  * Loads a single script to provide the photocrati_ajax settings to the web browser
  */
 static function register_scripts()
 {
     $settings = C_NextGen_Settings::get_instance();
     $router = C_Router::get_instance();
     wp_register_script('photocrati_ajax', $router->get_static_url('photocrati-ajax#ajax.min.js'), array('jquery'));
     $vars = array('url' => $settings->get('ajax_url'), 'wp_home_url' => $router->get_base_url('home'), 'wp_site_url' => $router->get_base_url('site'), 'wp_root_url' => $router->get_base_url('root'), 'wp_plugins_url' => $router->get_base_url('plugins'), 'wp_content_url' => $router->get_base_url('content'), 'wp_includes_url' => includes_url(), 'ngg_param_slug' => C_NextGen_Settings::get_instance()->get('router_param_slug', 'nggallery'));
     wp_localize_script('photocrati_ajax', 'photocrati_ajax', $vars);
 }
Example #22
0
function oficialoembed_support_scripts()
{
    if (is_singular(array('post', 'page'))) {
        wp_enqueue_style('wp-embed-template-ie');
        wp_enqueue_style('oficial_wp_embed_style', includes_url('css/wp-embed-template.min.css'));
        wp_enqueue_script('oficial_oembed_script', includes_url('js/wp-embed-template.min.js'), array(), '', true);
    }
}
 public function add_editor_controll_options($args)
 {
     if ($args['type'] == 'editor') {
         $args['choices']['content_css'] = includes_url("css/dashicons.min.css") . ',' . includes_url('js/tinymce') . '/skins/wordpress/wp-content.css';
         $args['choices']['plugins'] = 'colorpicker,lists,fullscreen,image,wordpress,wpeditimage,wplink';
     }
     return $args;
 }
/**
 * Plugin Name: Buddypress Upload Avatar Ajax
 * Plugin URI: http://tutviet.net
 * Version: 1.0.1
 * Author: Huu Ha
 * Author URI: http://tutviet.net
 * License: GPL
 * 
 * Description: Allow you add upload avatar function with ajax in register page
 */
function plugin_scripts()
{
    $plugin_url = plugins_url('', __FILE__);
    wp_enqueue_style('jcrop');
    wp_enqueue_script('plupload-handlers');
    wp_enqueue_script('tutviet-handle-upload', $plugin_url . '/js/handle-upload.js', array('jquery', 'plupload-handlers', 'jcrop'));
    wp_localize_script('tutviet-handle-upload', 'tutviet_custom_js', array('confirmMsg' => __('Are you sure?', 'tutviet'), 'nonce' => wp_create_nonce('tv_nonce'), 'ajaxurl' => admin_url('admin-ajax.php'), 'plupload' => array('url' => admin_url('admin-ajax.php') . '?nonce=' . wp_create_nonce('tutviet_image'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true)));
}
/**
* Enqueue scripts
*/
function my_scripts()
{
    wp_deregister_script('jquery');
    wp_register_script('jquery', includes_url() . 'js/jquery/jquery.js', null, '', false);
    wp_enqueue_script('jquery');
    wp_enqueue_script('map', '//maps.google.com/maps/api/js?sensor=true', array(), '1.0.0', true);
    wp_enqueue_script('app', get_template_directory_uri() . '/dist/js/app.min.js', array(), '', false);
}
 function enqueue_image_editor_scripts()
 {
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_enqueue_script('wp-ajax-response');
     wp_enqueue_script('rtmedia-image-edit', admin_url("js/image-edit{$suffix}.js"), array('jquery', 'json2', 'imgareaselect'), false, 1);
     wp_enqueue_style('rtmedia-image-edit', RTMEDIA_URL . 'app/assets/css/image-edit.css');
     wp_enqueue_style('rtmedia-image-area-select', includes_url('/js/imgareaselect/imgareaselect.css'));
 }
Example #27
0
 function add_js()
 {
     global $bp;
     $baseurl = includes_url('js/tinymce');
     if ($this->enable_tinymce_on_page()) {
         wp_tiny_mce($this->is_teeny, array('mode' => 'textareas'));
     }
 }
 function enqueue_scripts($page)
 {
     if ('settings_page_tinymce-advanced' == $page) {
         wp_enqueue_script('tadv-js', TADV_URL . 'js/tadv.js', array('jquery-ui-sortable'), '4.0', true);
         wp_enqueue_style('tadv-mce-skin', includes_url('js/tinymce/skins/lightgray/skin.min.css'), array(), '4.0');
         wp_enqueue_style('tadv-css', TADV_URL . 'css/tadv-styles.css', array('editor-buttons'), '4.0');
         add_action('admin_footer', array(&$this, 'load_mce_translation'));
     }
 }
Example #29
0
 public function initScripts($page)
 {
     if (!$this->enqueueCheck($page)) {
         return;
     }
     wp_enqueue_script('wpforms-plupload-setup', $this->getBaseUrl() . '/assets/js/plupload-setup.min.js', array('jquery', 'plupload-all'), false, true);
     wp_enqueue_style('wpforms-plupload', $this->getBaseUrl() . '/assets/css/plupload.css');
     self::$params[$this->attributes['id']] = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => $this->attributes['browse_button'], 'container' => $this->attributes['container'], 'drop_element' => $this->attributes['drop_element'], 'file_data_name' => $this->attributes['file_data_name'], 'preview_thumb_id' => $this->attributes['preview_thumb_id'], 'multiple_queues' => false, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files', 'wpforms'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multipart_params' => array('_ajax_nonce' => wp_create_nonce($this->attributes['ajax_action']), 'action' => $this->attributes['ajax_action']));
 }
 /**
  * Enqueue scripts and styles
  *
  * @return void
  */
 static function admin_enqueue_scripts()
 {
     // Enqueue same scripts and styles as for file field
     parent::admin_enqueue_scripts();
     wp_enqueue_style('rwmb-plupload-image', RWMB_CSS_URL . 'plupload-image.css', array('wp-admin'), RWMB_VER);
     wp_enqueue_script('rwmb-plupload-image', RWMB_JS_URL . 'plupload-image.js', array('jquery-ui-sortable', 'wp-ajax-response', 'plupload-all'), RWMB_VER, true);
     wp_localize_script('rwmb-plupload-image', 'RWMB', array('url' => RWMB_URL));
     wp_localize_script('rwmb-plupload-image', 'rwmb_plupload_defaults', array('runtimes' => 'html5,silverlight,flash,html4', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => _x('Allowed Image Files', 'image upload', 'rwmb'), 'extensions' => 'jpg,jpeg,gif,png')), 'multipart' => true, 'urlstream_upload' => true));
 }