Search Results

Search found 3830 results on 154 pages for 'plugins'.

Page 24/154 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Installing and using acts-as-taggable-on

    - by seaneshbaugh
    This is going to be a really dumb question, I just know it, but I'm going to ask anyways because it's driving me crazy. How do I get acts-as-taggable-on to work? I installed it as a gem with gem install acts-as-taggable-on because I can't ever seem to get installing plugins to work, but that's a whole other batch of questions that are all probably really dumb. Anyways, no problems there, it installed correctly. I did ruby script/generate acts_as_taggable_on_migration and rake db:migrate, again no problems. I added acts_as_taggable to the model I want to use tags with, started up the server and then loaded the index for the model just to see if what I've got so far is working and got the following error: undefined local variable or method `acts_as_taggable' for #. I figure that just means I need to do something like require 'acts-as-taggable-on' to my model's file because that's typically what's necessary for gems. So I did that hit refresh and got uninitialized constant ActiveRecord::VERSION. I'm not even going to pretend to begin to know what that means went wrong. Did I go wrong somewhere or there something else I need to do. The installation instructions seem to me like they just assume you generally know what you're doing and don't even begin to explain what to do when things go wrong.

    Read the article

  • Autocomplete and IE7 - slowness, sluggishness as overall pagesize grows?

    - by wchrisjohnson
    Hi, I have the autocomplete plugin (http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/, version 1.1 and 1.0.2) on a project to add pieces of "equipment" to a "project". On a fresh project the plugin works great; the data returned from the database comes back FAST, you can scroll the list fast, and can select an item and move on to the next one. Once I have a project established with equipment on it, and I go to add equipment, the performance is pretty bad. It takes 4-5 seconds to get the list of data back from the server, scrolling the list is painful, and the cursor takes several seconds to settle on an item. Repainting the page after the list goes away is slow. This is occurring in IE7, latest version. FF3 and Chrome are fine, very snappy. The pagesize is about 40K overall. I'm thinking this is an issue with the IE7 Javascript engine, or an edge case with this plugin and IE7; it works quickly enough in FF3+. I would appreciate any ideas, solutions, known issues, or thoughts on how to more specifically pin this down. I'd love to post sample code, but this is a corporate app, and I'm not how useful it would be given that the server side piece cannot be shown; ie: you can't pull it down and test it like a self contained piece of code.. Thanks in advance! Chris

    Read the article

  • jQuery - Callback failing if there is no options parameter

    - by user249950
    Hi, I'm attempting to build a simple plugin like this (function($) { $.fn.gpSlideOut = function(options, callback) { // default options - these are used when no others are specified $.fn.gpSlideOut.defaults = { fadeToColour: "#ffffb3", fadeToColourSpeed: 500, slideUpSpeed: 400 }; // build main options before element iteration var o = $.extend({}, $.fn.gpSlideOut.defaults, options); this.each(function() { $(this) .animate({backgroundColor: o.fadeToColour},o.fadeToColourSpeed) .slideUp(o.SlideUpSpeed, function(){ if (typeof callback == 'function') { // make sure the callback is a function callback.call(this); // brings the scope to the callback } }); }); return this; }; // invoke the function we just created passing it the jQuery object })(jQuery); The confusion I'm having is that normally on jQuery plugins you can call something like this: $(this_moveable_item).gpSlideOut(function() { // Do stuff }); Without the options parameter, but it misses the callback if I do it like that so I have to always have var options = {} $(this_moveable_item).gpSlideOut(options, function() { // Do stuff }); Even if I only want to use the defaults. Is there anyway to make sure the callback function is called whether or not the options parameter is there? Cheers.

    Read the article

  • Jrails and jquery-rails together?

    - by ecoologic
    I hope you forgive me if I'm a little confused about this. Jrails rewrites all the helper methods for rjs otherwise in prototype. Jquery-rails overrides rails.js (so I taught the rjs helpers as well, but I see it's not) and the rest of the libraries in jquery instead of prototype. Does it means that with just Jquery-rails I can't use rjs at all? Then do these gems work well together and let me completely forget prototype? Is there any disadvantage in using them together? I read some complaining about the fact that jrails uses jq 1.5 and now there is 1.8, but jquery-rails gives me the last version (is there retro compatibility?), but how will this affect my development (using both the gems together)? I mean have you got some examples of jquery-ui plugins I can't use or I could have problems with? Any help is appreciated. Don't get me wrong, I'm not against prototype, just I keep on having conflicts over conflicts using both of them, and I have to chose I pick Jquery.

    Read the article

  • how can a Win32 App plugin load its DLL in its own directory

    - by Jean-Denis Muys
    My code is a plugin for a specific Application, written in C++ using Visual Studio 8. It uses two DLL from an external provider. Unfortunately, my plugin fails to start because the DLLs are not found (I put them in the same directory as the plugin itself). When I manually move or copy the DLLs to the host application directory, then the plugin loads fine. This moving was deemed unacceptably cumbersome for the end user, and I am looking for a way for my plugin to load its DLLs transparently. What can I do? Relevant details: the host Application plugins are located in a directory mandated by the host application. That directory is not in the DLL search path and I don't control it. The plugin is itself packaged as a subdirectory of the plugin directory, holding the plugin code itself, but also any resource associated with the plugin (eg images, configuration files…). I control what's inside that subdirectory, called a "bundle", but not where it's located. the common plugin installation idiom for that App is for the end user to copy the plugin bundle to the plugin directory. This plugin is a port from the Macintosh version of the plugin. On the Mac there is no issue because each binary contains its own dynamic library search path, which I set as I needed to for my plugin binary. To set that on the Mac simply involves a project setting in the Xcode IDE. This is why I would hope for something similar in Visual Studio, but I could not find anything relevant. Moreover, Visual Studio's help was anything but, and neither was Google. A possible workaround would be for my code to explicitly tell Windows where to find the DLL, but I don't know how, and in any case, since my code is not even started, it hasn't got the opportunity to do so. As a Mac developer, I realize that I may be asking for something very elementary. If such is the case, I apologize, but I have run out of hair to pull out.

    Read the article

  • How to jQuery plugin effects to items created later in the DOM

    - by Dan Denney
    How do I apply jQuery plugin effects to items that are created by an event? So, what I am attempting to do is have all uls throughout a site use the jquery.scroll.js plugin for styling. I currently have it working on all active uls. However, there are some category/subcategory sections. I am still new to writing any jQuery on my own and there is a leap in logic that I don't understand on applying plugins to items when they are loaded later. In the real example, users click a category from a ul and a sub category is loaded via Rails and JSON. For a light sample, I made a jsfiddle that simulates the issue that I run into. The category ul is styled correctly, but the subcategory ul doesn't pick up the styling. I'm hoping for some assistance not just in whipping up some code to fix it, but in pointing me in the direction of what I need to learn for this functionality. http://jsfiddle.net/dandenney/25R8F/1/ Thank you in advance!

    Read the article

  • Trying to make a plugin system in C++/Qt

    - by Pirate for Profit
    I'm making a task-based program that needs to have plugins. Tasks need to have properties which can be easily edited, I think this can be done with Qt's Meta-Object Compiler reflection capabilities (I could be wrong, but I should be able to stick this in a QtPropertyBrowser?) So here's the base: class Task : public QObject { Q_OBJECT public: explicit Task(QObject *parent = 0) : QObject(parent){} virtual void run() = 0; signals: void taskFinished(bool success = true); } Then a plugin might have this task: class PrinterTask : public Task { Q_OBJECT public: explicit PrinterTask(QObject *parent = 0) : Task(parent) {} void run() { Printer::getInstance()->Print(this->getData()); // fictional emit taskFinished(true); } inline const QString &getData() const; inline void setData(QString data); Q_PROPERTY(QString data READ getData WRITE setData) // for reflection } In a nutshell, here's what I want to do: // load plugin // find all the Tasks interface implementations in it // have user able to choose a Task and edit its specific Q_PROPERTY's // run the TASK It's important that one .dll has multiple tasks, because I want them to be associated by their module. For instance, "FileTasks.dll" could have tasks for deleting files, making files, etc. The only problem with Qt's plugin setup is I want to store X amount of Tasks in one .dll module. As far as I can tell, you can only load one interface per plugin (I could be wrong?). If so, the only possible way to do accomplish what I want is to create a FactoryInterface with string based keys which return the objects (as in Qt's Plug-And-Paint example), which is a terrible boilerplate that I would like to avoid. Anyone know a cleaner C++ plugin architecture than Qt's to do what I want? Also, am I safely assuming Qt's reflection capabilities will do what I want (i.e. able to edit an unknown dynamically loaded tasks' properties with the QtPropertyBrowser before dispatching)?

    Read the article

  • .ico icons not showing up on Windows

    - by Ali
    I followed the The Qt Resource System guide and the .ico icons appear on Linux. The icons are not showing up on Windows when I try to run the applicaton from Qt Creator. I suspect a plugin issue based on Qt/C++: Icons not showing up when program is run under windows O.S but I failed to figure out what to do from the guide How to Create Qt Plugins. Is it a plugin issue or why aren't the icons showing up on Windows? If it is a plugin issue: How do I tell my applicaton where to find the qico.dll? Details of the environment: Works on: Kubuntu 12.04 LTS, Qt Creator 2.4.1 and Qt 4.7.4 (64 bit) Fails on: Windows XP SP2 32 bit, Qt Creator 2.4.1 and Qt 4.7.4 (32 bit) Everyting is at its default (as installed out of the box), I did not mess with the settings. resources.qrc <!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>images/spreadsheet.ico</file> </qresource> </RCC> Also tried with <qresource prefix="/">. From the applicaton.pro RESOURCES += \ resources.qrc OTHER_FILES += \ images/spreadsheet.ico In the corresponding source file QIcon(":/images/spreadsheet.ico") I repeat: it works on Linux.

    Read the article

  • Trying to make a plugin system in C++

    - by Pirate for Profit
    I'm making a task-based program that needs to have plugins. Tasks need to have properties which can be easily edited, I think this can be done with Qt's Meta-Object Compiler reflection capabilities (I could be wrong, but I should be able to stick this in a QtPropertyBrowser?) So here's the base: class Task : public QObject { Q_OBJECT public: explicit Task(QObject *parent = 0) : QObject(parent){} virtual void run() = 0; signals: void taskFinished(bool success = true); } Then a plugin might have this task: class PrinterTask : public Task { Q_OBJECT public: explicit PrinterTask(QObject *parent = 0) : Task(parent) {} void run() { Printer::getInstance()->Print(this->getData()); // fictional emit taskFinished(true); } inline const QString &getData() const; inline void setData(QString data); Q_PROPERTY(QString data READ getData WRITE setData) // for reflection } In a nutshell, here's what I want to do: // load plugin // find all the Tasks interface implementations in it // have user able to choose a Task and edit its specific Q_PROPERTY's // run the TASK It's important that one .dll has multiple tasks, because I want them to be associated by their module. For instance, "FileTasks.dll" could have tasks for deleting files, making files, etc. The only problem with Qt's plugin setup is I want to store X amount of Tasks in one .dll module. As far as I can tell, you can only load one interface per plugin (I could be wrong?). If so, the only possible way to do accomplish what I want is to create a FactoryInterface with string based keys which return the objects (as in Qt's Plug-And-Paint example), which is a terrible boilerplate that I would like to avoid. Anyone know a cleaner C++ plugin architecture than Qt's to do what I want? Also, am I safely assuming Qt's reflection capabilities will do what I want (i.e. able to edit an unknown dynamically loaded tasks' properties with the QtPropertyBrowser before dispatching)?

    Read the article

  • Best way to implement plugin framework - are DLLs the only way (C/C++ project)?

    - by Microkernel
    Introduction: I am currently developing a document classifier software in C/C++ and I will be using Naive-Bayesian model for classification. But I wanted the users to use any algorithm that they want(or I want in the future), hence I went to separate the algorithm part in the architecture as a plugin that will be attached to the main app @ app start-up. Hence any user can write his own algorithm as a plugin and use it with my app. Problem Statement: The way I am intending to develop this is to have each of the algorithms that user wants to use to be made into a DLL file and put into a specific directory. And at the start, my app will search for all the DLLs in that directory and load them. My Questions: (1) What if a malicious code is made as a DLL (and that will have same functions mandated by plugin framework) and put into my plugins directory? In that case, my app will think that its a plugin and picks it and calls its functions, so the malicious code can easily bring down my entire app down (In the worst case could make my app as a malicious code launcher!!!). (2) Is using DLLs the only way available to implement plugin design pattern? (Not only for the fear of malicious plugin, but its a generic question out of curiosity :) ) (3) I think a lot of softwares are written with plugin model for extendability, if so, how do they defend against such attacks? (4) In general what do you think about my decision to use plugin model for extendability (do you think I should look at any other alternatives?) Thank you -MicroKernel :)

    Read the article

  • OSGI, Servlets and JPA hello world / tutorial / example

    - by Kamil
    I want to build a web application which basically is a restful web-service serving json messages. I would like it to be as simple as possible. I was thinking about using servlets (with annotations). JPA as a database layer is a must - Toplink or Hibernate. Preferably working on Tomcat. I want to have app divided into modules serving different functionality (auth service, customer service, etc..). And I would like to be able to update those modules without reinstalling whole application on the server - like eclipse plugins, user is notified (when he enters webapp's home url) that update is available, clicks it, and app is downloading and installing updated module. I think this functionality can be made with OSGI, but I can't find any example code, or tutorial with simple hello world updatable servlet providing some data from database through jpa. I'm looking for an advice: - Is OSGI the right tool for this or it can be done with something simpler? - Where can I find some examples covering topic (or topics) which I need for this project. - Which OSGI implementation would be best-simplest for this task. *My knowledge of OSGI is basic. I know how bundles are described, I understand concept of OSGI container and what it does. I have never created any OSGI app yet.

    Read the article

  • What is the standard way to bundle OSGi dependent libraries?

    - by Chris
    Hi, I have a project that references a number of open source libraries, some new, some not so new. That said, they are all stable and I wish to stick with my chosen versions until I have time to migrate to the newer versions (I tested hsqldb 2.0 yesterday and it contains many api changes). One of the libraries I have wish to embed is Jasper Reports, but as you all surely know, it comes with a mountain of supporting jar files and I have only need a subset of the mountain (known) therefore I am planning to custom bundle all of my dependant libraries. So: Does everyone custom-make their own OSGi bundles for open-source libraries they are using or is there a master source of OSGi versions of common libraries? Also, I was thinking that it would be far simpler for each of my bundles simply to embed their dependent jars within the bundle itself. Is this possible? If I choose to embed the 3rd party foc libraries within a bundle, I assume I will need to produce 2 jar files, one without the embedded libraries (for libraries to be loaded via the classpath via standard classloader), and one osgi version that includes the embedded libraryy, therefore should I choose a bundle name like this <<myprojectname>>-<<subproject>>-osgi-.1.0.0.jar ? If I cannot embed the open source libraries and choose to custom bundle the open source libraries (via bnd), should I choose a unique bundle name to avoid conflict with a possible official bundle? e.g. <<myprojectname>>-<<3rdpartylibname>>-<<3rdpartylibversion>>.jar ? My non-OSGi enabled project currently scans for custom plugins via scanning the META-INF folders in my various plugin jars via Service.providers(...). If I go OSGi, will this mechanism still work?

    Read the article

  • Inline form editing on client side

    - by bykasif
    I see some web sites use dynamic forms(I am not sure about how to call them!) to edit a group of data. For example: there is a group of data such as name, last name, city, country.etc. when user clicks on EDIT button, instead of doing postback, a form, consisisting of 2 textboxes + 2 comboboxes, dynamically opens to edit,And then when you click on Save button, edit form disappears, and all data updates.. Now, I know what happens over here is using Ajax for server calls and some javascript for dom manipulation.. I even found some jquery plugins for textbox editing.. However, I could not found anything for full implementation of form fields. Therefore I have implemented it on asp.net by jquery ajax calls and dom manipulation manually. here is my process: 1) when Edit button clicked: Make a ajax call to server to retrieve necessary formedit.aspx 2) it returns editable form fields with values assigned. 3) when Save button clicked: make ajax call to server to retrieve formupdateprocess.aspx page. it basically do the database updates and then return necessary DOM snipplet (...) to insert current page.. well it works but MY PROBLEM, is performance.. Result seems slower than samples I see in other sites.:(( IS there anything that I dont know? a better way to implement this??

    Read the article

  • Tiny MCE (jquery plugin version) not showing toolbar in IE (works fine in other browsers)

    - by I am Wonder
    I had an implementation working well but for some reason IE decided it was tired of playing nice. I have an advanced implementation of TinyMCE (the jquery plugin version - see http://tinymce.moxiecode.com/examples/example_23.php for details). It still works great in all browsers but IE. In IE it shows the drop-down options for Format, Font family, and Font size, but only as text.. not as a drop down normally looks. All other buttons on the toolbar are missing. (I've tried IE8 and IE8 Compatibility Mode) I get a javascript error: Syntax error Line 36 Char 1. Unfortunately the javascript is being loaded dynamically so this doesn't help me. Here is my implementation code for the TinyMCE editor: $(function () { $('#InputStuffHere').tinymce({ // General options theme: "advanced", plugins: "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,inlinepopups,preview,media,searchreplace,contextmenu,paste,fullscreen,noneditable,visualchars,nonbreaking,template", // Theme options theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,hr,removeformat", theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,|,forecolor,backcolor,|,spellchecker", theme_advanced_buttons3 : "", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_statusbar_location: "bottom", theme_advanced_resizing: true, // Drop lists for link/image/media/template dialogs template_external_list_url: "lists/template_list.js", external_link_list_url: "lists/link_list.js", external_image_list_url: "lists/image_list.js", media_external_list_url: "lists/media_list.js", //initialization callback init_instance_callback: "TinyMCEReady", add_form_submit_trigger : false }); }); So... anyone seen anything like this or have any ideas for me? Thank you so much everyone!

    Read the article

  • How do I use Haml in a view in my new plugin?

    - by Eric
    I'm creating a new plugin for a jruby on rails application that will eventually be turned into a gem. Inside my plugin I have controllers, helpers and views. For my views I'd like to use Haml. The problem is that I can't seem to get it to recognize that they are haml templates. Is it even possible to do this? Is there a way for a plugin to have Haml as a dependency for its view? And by that I mean, I intend for the plugin that I'm creating to have a view created by the plugin, that can be used by the application developer. for example: vendor/ plugins/ my_plugin/ lib/ app/ views/ my_plugin_demo/ index.haml.html controllers/ my_plugin_demo_controller.rb helpers/ In my plugin's init.rb, I tried: require 'my_plugin' require 'haml' #doesn't seem to make a difference :( but that didn't seem to make any difference. Has anybody had any experience with this? I can't seem to find any documentation on how to make this work. Are plugin views restricted to .erb templates?

    Read the article

  • Jquery (non-gem) plugin won't work in my rails 3.2 app

    - by jfdimark
    I'm trying to equalize columns in my rails 3.2 app, and while there may be a better way to do it then my current attempt, after hours of trying to make it work I'd like to see if anyone can point out specifically why this jQuery plugin (which isn't a gem) is not working. I'm not getting any errors in the developer console, so it's hard to pin point. Here's the relevant code: The index view, where I've followed the plugin's instructions: div id="column-group"> <div class="equalize span5 offset1 UserProfile"> <% if user_signed_in? %> <h3>Hello <%= current_user.name %>!</h3> </div> <div class="equalize span5 MemberDisplay"> My application.js file, where I've also included the specific js code, so it would definitely be picked up by the application: //= require jquery //= require jquery_ujs //= require bootstrap //= require equalize_column_heights //= require_tree . $(document).ready(function() { $("#column-group").equalize_column_heights("equalize"); }); The jQuery plugin code, which is saved in my vendor/assets/javascripts folder: (function ($) { $.fn.equalize_column_heights = function (equalize_class) { var tallest_column=0; parent_id = "column-group" + $(this).attr("id") + " ." + equalize_class; $(parent_id).each(function(index, value) { if (tallest_column < $(this).height()){ tallest_column = $(this).height(); } }); $(parent_id).each(function(index, value) { $(this).css({'min-height': tallest_column}); }); } }(jQuery)); I've read all the rails guides documentation on the asset pipeline and all the relevant jQuery-rails3 questions on SO, but after several hours, I just can't seem to figure this one out. If anyone can point to other tutorials on how to get non-gem jQuery plugins to work in a Rails 3.2 app then I'd be glad to take a look!

    Read the article

  • cannot enter text in query popup input field

    - by raja
    i am unable to enter text in jquery popup text field...... i am using following plugins my html code </head> <body onmousedown="return false;"> <div id="container"></div> <div id="divMenu"></div> </body> </html> i am appending popup tags as function setupCalibration(){ $('#container').append(' <div data-role="popup" id="calibratePopup" data-transition="flip" data-theme="e" data-overlay-theme="a" class="ui-content" style=" width:300px;height: 200px; z-index:1; display:none;"><label for="name">Text Input:</label><input type="text" name="name" id="name" value="" /></div>'); } and this is how i am invoking popup on click of divmenu button document.getElementById('divMenu').addEventListener('click', function() { $( '#calibratePopup' ).popup({display:block}); $( '#calibratePopup' ).show(); $( '#calibratePopup' ).popup( "open"); }, false); i am able to show popup,but input field is not responding

    Read the article

  • How do I run Munin plugins written in Ruby, using RVM?

    - by hlg
    Hi! I try to run some Munin plugins written in Ruby. I would like to use RVM, so Munin needs to know where to find Ruby. I tried to change the line calling munin-cron in the cron file as follows: */5 * * * * munin bash -c 'source /usr/local/lib/rvm && rvm 1.9.2@munin && /usr/bin/munin-cron' This leads to error messages in munin-node.log, saying /usr/bin/env: ruby: No such file or directory When I change the plugins' shebangs to the actual path of the Ruby executable it works, but the RVM environment should be set so that '/usr/bin/env ruby' works. It does when I execute the plugins as root. Any ideas?

    Read the article

  • JQuery Tooltip Plugin from Jorn

    - by Jeff Ancel
    I am thinking someone may have run across this one, but not sure. From a high level, I am trying to roll over a input [type=text] and display a tool tip (with the contained value) using the plugin available at http://bassitance.de. I have to use titles and classes for validation on the specific elements, so I put a blank div to hold the input [type=text] value for the roll over. Issue: It won't hold the value of 2 text boxes at once. Once I put a value in the box on the right, the tooltip on the left goes away. Same thing if I switch it aroun. I can't keep a tooltip on more than one element. Here is the code (Note: You will have to download the plugins in the source as I am not sure where the live versions are if there are any). <link rel="stylesheet" href="/scripts/jquery-tooltip/jquery.tooltip.css" /> <script type="text/javascript" src="/scripts/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/scripts/jquery-tooltip/jquery.tooltip.min.js"></script> <script type="text/javascript"> $(function(){ $("input").change(function(){ var newTitle = $(this).val(); $(this).parent().attr("title",newTitle); // re-init tool tip reload(); }); // Init tooltip reload(); }); reload = function(){ $("div").tooltip(); } </script> <body> <table border="1px solid black"> <tr> <td title="hello"> <div> <input type="text" value=""/> </div> </td> <td> <div> <input type="text" value=""/> </div> </td> </tr> </table> <div id="debug"></div> </body> </html>

    Read the article

  • Client-side templating frameworks to streamline using jQuery with REST/JSON

    - by Tauren
    I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate HTML into the page. Right now, when a user on my site clicks a link to My Projects, the server generates HTML like this: <dl> <dt>Clean Toilet</dt> <dd>Get off your butt and clean this filth!</dd> <dt>Clean Car</dt> <dd>I think there's something growing in there...</dd> <dt>Replace Puked on Baby Sheets</dt> </dl> I'm changing this so that clicking My Projects will now do a GET request that returns something like this: [ { "name":"Clean Car", "description":"I think there's something growing in there..." }, { "name":"Clean Toilets", "description":"Get off your butt and clean this filth!" }, { "name":"Replace Puked on Baby Sheets" } ] I can certainly write custom jQuery code to take that JSON and generate the HTML from it. This is not my question, and I don't need advice on how to do that. What I'd like to do is completely separate the presentation and layout from the logic (jquery code). I don't want to be creating DL, DT, and DD elements via jQuery code. I'd rather use some sort of HTML templates that I can fill the data in to. These templates could simply be HTML snippets that are hidden in the page that the application was loaded from. Or they could be dynamically loaded from the server (to support user specific layouts, i18n, etc.). They could be displayed a single time, as well as allow looping and repeating. Perhaps it should support sub-templates, if/then/else, and so forth. I have LOTS of lists and content on my site that are presented in many different ways. I'm looking to create a simple and consistent way to generate and display content without creating custom jQuery code for every different feature on my site. To me, this means I need to find or build a small framework on top of jQuery (probably as a plugin) that meets these requirements. The only sort of framework that I've found that is anything like this is jTemplates. I don't know how good it is, as I haven't used it yet. At first glance, I'm not thrilled by it's template syntax. Anyone know of other frameworks or plugins that I should look into? Any blog posts or other resources out there that discuss doing this sort of thing? I just want to make sure that I've surveyed everything out there before building it myself. Thanks!

    Read the article

  • While loop: Output something different on every second result

    - by Wade D Ouellet
    Hi, I am running a plugin called Category Posts Widget for WordPress: http://wordpress.org/extend/plugins/category-posts/ It uses a while loop to display the names of all posts in a certain category. I want to get it so that there is a different class attached to the li tag on every second output. Here is the block of code for the plugin: // Post list echo "<ul>\n"; while ( $cat_posts->have_posts() ) { $cat_posts->the_post(); ?> <li class="cat-post-item"> <a class="post-title" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> <?php if ( function_exists('the_post_thumbnail') && current_theme_supports("post-thumbnails") && $instance["thumb"] && has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail( 'cat_post_thumb_size'.$this->id ); ?> </a> <?php endif; ?> <?php if ( $instance['date'] ) : ?> <p class="post-date"><?php the_time("j M Y"); ?></p> <?php endif; ?> <?php if ( $instance['excerpt'] ) : ?> <?php the_excerpt(); ?> <?php endif; ?> <?php if ( $instance['comment_num'] ) : ?> <p class="comment-num">(<?php comments_number(); ?>)</p> <?php endif; ?> </li> <?php } echo "</ul>\n"; I am just trying to get it so on each second one in the output list, the li has a different class, so cat-post-item-alt for example. Thanks, Wade

    Read the article

  • How to merge jquery autocomplete and fcbkListSelection functionality?

    - by Ben
    Initial caveat: I am a newbie to jquery and javascript. I started using the autocomplete jquery plugin recently from bassistance.de. Yesterday, I found the fcbkListSelection plugin (http://www.emposha.com/javascript/fcbklistselection-like-facebook-friends-selector.html) and am using it to include a selector in my application. What I now want to do is to merge the 2 pieces of functionality since there are lots of items in my selector list. To be more specific, I want to put a "Filter by Name" text box above the facebook list selection object in my html. When the user types a few characters into the "Filter by Name" text box, I want the items in the Facebook list selector to only show the items that contain the typed characters -- kind of like what autocomplete does already, but rather than the results showing below the text input box, I want them to dynamically update the facebook list object. Is this possible and relatively straightforward? If so, can somebody please describe how to do it? If not, is there an easier way to approach this? Thanks! OK, to Spencer Ruport's comment, I guess I may have a more specific question already. Below is the current Javascript in my HTML file (angle brackets represent Django tags). #suggest1 and #fcbklist both do their separate pieces, but how do I get them to talk to each other? Do I need to further write javascript in my HTML file, or do I need to customize the guts of the plugins' .js? Does this help elaborate? $(document).ready(function() { var names = []; var count = 0; {% for a, b, c in friends_for_picker %} names[count] = "{{ b }}"; count = count+1; {% endfor %} function findValueCallback(event, data, formatted) { $("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result"); } function formatItem(row) { return row[0] + " (<strong>id: " + row[1] + "</strong>)"; } function formatResult(row) { return row[0].replace(/(<.+?>)/gi, ''); } $("#suggest1").autocomplete(names, { multiple: true, mustMatch: false, autoFill: true, matchContains: true, }); //id(ul id),width,height(element height),row(elements in row) $.fcbkListSelection("#fcbklist","575","50","4"); });

    Read the article

  • Written a resharper plugin that modifies the TextControl?

    - by Ajaxx
    Resharper claims to eat it's own dogfood, specifically, they claim that many of the features of Resharper are written ontop of R# (OpenAPI). I'm writing a simple plugin to fix up comments of the current document of a selection. When this plugin is run, it throws an exception as follows: Document can be modified inside a command scope only I've researched the error and can't find anything to help with this, so I'm hoping that possibly, you've written a plugin to accomplish this. If not, I hope the snippet is enough to help others get their own plugins underway. using System; using System.IO; using System.Windows.Forms; using JetBrains.ActionManagement; using JetBrains.DocumentModel; using JetBrains.IDE; using JetBrains.TextControl; using JetBrains.Util; namespace TinkerToys.Actions { [ActionHandler("TinkerToys.RewriteComment")] public class RewriteCommentAction : IActionHandler { #region Implementation of IActionHandler /// <summary> /// Updates action visual presentation. If presentation.Enabled is set to false, Execute /// will not be called. /// </summary> /// <param name="context">DataContext</param> /// <param name="presentation">presentation to update</param> /// <param name="nextUpdate">delegate to call</param> public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate) { ITextControl textControl = context.GetData(DataConstants.TEXT_CONTROL); return textControl != null; } /// <summary> /// Executes action. Called after Update, that set ActionPresentation.Enabled to true. /// </summary> /// <param name="context">DataContext</param> /// <param name="nextExecute">delegate to call</param> public void Execute(IDataContext context, DelegateExecute nextExecute) { ITextControl textControl = context.GetData(DataConstants.TEXT_CONTROL); if (textControl != null) { TextRange textSelectRange; ISelectionModel textSelectionModel = textControl.SelectionModel; if ((textSelectionModel != null) && textSelectionModel.HasSelection()) { textSelectRange = textSelectionModel.Range; } else { textSelectRange = new TextRange(0, textControl.Document.GetTextLength()); } IDocument textDocument = textControl.Document; String textSelection = textDocument.GetText(textSelectRange); if (textSelection != null) { StringReader sReader = new StringReader(textSelection); StringWriter sWriter = new StringWriter(); Converter.Convert(sReader, sWriter); textSelection = sWriter.ToString(); textDocument.ReplaceText(textSelectRange, textSelection); } } } #endregion } } So what is this command scope it wants so badly? I had some additional logging in this prior to posting it so I'm absolutely certain that both the range and text are valid. In addition, the error seems to indicate that I'm missing some scope that I've been, as yet, unable to find.

    Read the article

  • WordPress: Display Online Users' Avatars

    - by Wade D Ouellet
    Hi, I'm using version 2.7.0 of this WordPress plugin to display which users are currently online (the latest version doesn't work): http://wordpress.org/extend/plugins/wp-useronline/ It's working great but I would love to be able to alter it quickly to display the users' avatars instead of their names. Hoping someone with pretty good knowledge of WordPress queries and functions can help. The part below seems to be the part that handles all this. If this isn't enough, here is the link to download the version I am using with the full php files: http://downloads.wordpress.org/plugin/wp-useronline.2.70.zip // If No Bot Is Found, Then We Check Members And Guests if ( !$bot_found ) { if ( $current_user->ID ) { // Check For Member $user_id = $current_user->ID; $user_name = $current_user->display_name; $user_type = 'member'; $where = $wpdb->prepare("WHERE user_id = %d", $user_id); } elseif ( !empty($_COOKIE['comment_author_'.COOKIEHASH]) ) { // Check For Comment Author (Guest) $user_id = 0; $user_name = trim(strip_tags($_COOKIE['comment_author_'.COOKIEHASH])); $user_type = 'guest'; } else { // Check For Guest $user_id = 0; $user_name = __('Guest', 'wp-useronline'); $user_type = 'guest'; } } // Check For Page Title if ( is_admin() && function_exists('get_admin_page_title') ) { $page_title = ' &raquo; ' . __('Admin', 'wp-useronline') . ' &raquo; ' . get_admin_page_title(); } else { $page_title = wp_title('&raquo;', false); if ( empty($page_title) ) $page_title = ' &raquo; ' . strip_tags($_SERVER['REQUEST_URI']); elseif ( is_singular() ) $page_title = ' &raquo; ' . __('Archive', 'wp-useronline') . ' ' . $page_title; } $page_title = get_bloginfo('name') . $page_title; // Delete Users $delete_users = $wpdb->query($wpdb->prepare(" DELETE FROM $wpdb->useronline $where OR timestamp < CURRENT_TIMESTAMP - %d ", self::$options->timeout)); // Insert Users $data = compact('user_type', 'user_id', 'user_name', 'user_ip', 'user_agent', 'page_title', 'page_url', 'referral'); $data = stripslashes_deep($data); $insert_user = $wpdb->insert($wpdb->useronline, $data); // Count Users Online self::$useronline = intval($wpdb->get_var("SELECT COUNT(*) FROM $wpdb->useronline"));

    Read the article

  • How to implement a tagging plugin for jQuery

    - by anxiety
    Goal: To implement a jQuery plugin for my rails app (or write one myself, if necessary) that creates a "box" around text after a delimiter is typed. Example: With tagging on SO, the user begins typing a tag, then selects one from the drop-down list provided. The input field recognizes that a tag has been selected, puts a space and then is ready for the next tag. Similarly, I am attempting to use this plugin to put a box around the previously entered tag before moving to to accept the next tag/input. The instructions in the README.txt seem simple enough, however I have been receiving a $(".tagbox").tagbox is not a function error when debugging my app with firebug. Here is what I have in my application.js: $(document).ready( function(){ $('.tagbox').tagbox({ separator: /\[,]/, // specifying comma separation for <code>tags</code> }); }); And here is my _form.html.erb: <% form_for @tag do |f| %> <%= f.error_messages %> <p> <%= f.label :name %><br /> <%= text_field :tag, :name, { :method => :get, :class => "tagbox" } %> </p> <p><%= f.submit "Submit" %></p> <% end %> I have omitted some other code (namely the implementation of an autocomplete plugin) existing within my _form.html.erb and application.js for sake of readability. The inclusion or exclusion of this omitted code does not affect the performance of this plugin. I have included all of the necessary files for the tagbox plugin (as well as application.js after all other included JS files) within the javascript_include_tag in my application.html.erb file. I'm pretty much confused as to why I'd be getting this "not a function" error when jquery.tagbox.js clearly defines the function and is included in the head of my html page in question. I've been struggling with this plugin for longer than I'd like to admit, so any help would really be appreciated. And, of course, I'm open to any other plugins or from-scratch suggestions you may have in mind.. This tagbox plugin does not seem to have a wealth of documentation or any currently working examples. Also to note, I'm trying to avoid using jrails. Thanks for your time

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >