mercredi 5 août 2015
Contribution of IT Training Institute for better Career
Transpose Your Home and Office into a ResplendentBelvidere of Art and Culture with Bespoke Windows, Mirrors and Exquisite Glass Accessories
How You Can Get Study Abroad Scholarships in Italy?
The Brisbane air conditioning For Your premises keeps cool in summer
Factors to Be Considered For a Good Cattle Yard Design
What the UK Labour Leadership Election Could Mean For Businesses
Lynton Apartments In Blackpool : Offering Comforts Just Like Your Home
Best Selling Outfits For Summer Mix & Match- Uniquely Zero
Energy Efficient Edmond Replacement Windows are Home Improvement System
7 Alarm Sensors for Enhanced Home Security
How To Keep Your Office And Upholstery Clean
Simply the Best Water Damage Cleaning Guide
Fabulous collection of affordable women clothes online
Best Online Jewellery Shopping: Choose from The Wide Range
Grab The Best Offer While Looking For Vet Tools And Equipment For Sale
Retirement villages can be surreal with nice friends and terrific atmosphere!
Three most popular cable trays you should know about
Simple Guide to Roofing
Amaze Your Online Competitors With SEO Friendly Packages From Phoenix SEO Company
Cheap Auto Transport Shipping- No More a Daunting Process
What Features Does the Best Online Event Management Service Offer?
Maharaja express india: luxury in motion
Maximize Your Profits In Forex Market Using This Forex Trading Education
Find the Top Fragrances For Men Matching Your Budget
Pros and Cons of Investing in Turnkey Properties
How a Voice Call Service Provider in India can change the face of your Business
Advantages of Modular Kitchens in Small Sized House
Vitro fertilization (IVF)
Virk infertility clinic
Maldives Cruises & Dive Safaris Holiday Adventure
Why Should Software be Load Tested?
Aggression: What Can Happen When Men Reject Their Aggression?
Simple tips for softer, chewier cookies
Why would my garage door need service?
The main 6 Most Important Tips on While using the Vine App for Consultants and Freelance writers
A brief article for residential electric door opener
The Brought Lighting Technologies
Drones: Use, Health and safety and Adjustment
Why do you need Landscaping Professionals?
Bring Your Home Alive With New Ottawa Flooring
The Ultimate Guide To Crazy Bulk -Best Legal Steroids In Market
Most Frequently Asked Questions About Volunteering In India - iSpiice
Seek A Supporting Hand To Overcome Frustrating Issues
Foreign Businesses in Dubai Are Getting More Popular
Book printing service problems to be noticed
Delhi Manali Bus Tickets- The Amazing Manalis
Real Estate Scene in Karnal
Superior Product And Excellent Layout Provides You With Elegant And Modish Property
How Sofa And Window Cleaning Have Become Possible
The top benefits of udder cream
vendredi 31 juillet 2015
Top Web-Design Tips For Lead Generation
10 More Things You Can Do to Improve Your Facebook Business Page
Online Bookstore - No Renewals and No Returns
Use Best Calling Card to Call India From USA and Canada
Death of the iPod: The Music Player that Changed the World
Create dynamic business using Hosted ACT
SafeWay To Remove FileCoder Ransomware
Bonding With Your Unborn Baby
Permanent Hair Waving (Perms) for Short Hair
Desi Fashion – How Indian Ethnic Wear is again in Vogue
Katy Perry - Firework
Dr. APJ Abdul Kalam Bids Good Bye To The world, Don't Mourn instead Get Inspired
Google Stops Using Interstitial Mobile Ads after Feedback
YouTube Marketing: Why Is It Important and How To Do It?
In App Advertising is the Best Way to Promote App in 2015
Latest iPhone Game Reviews You Can Not Miss
Have You Tried These App Store Seo Tips Ever Before
How to Book Mango Airlines Flights?
Tips to consider while buying all season blankets online
How to get traffic to my blog - Web Gateway India
Enjoy Malayalam Karaoke Songs With Easy Downloads
Life is about HOPES. Who are the ARABIAN HEROES?
Money Transfer Technologies
Hosting Software Development Services in USA
Graviola Leaves and its Many Benefits
Top Clothing Apps- New Shopping Trend for Fashion Enthusiasts
Can custom coins be used as gifts for marriage anniversaries?
Open Source ERP (Odoo) – How it is Better than Conventional ERP Solutions?
Guidelines to Fix the "0x80070057" Error While Trying to Backup Files
Does and Don'ts of Creating a Website
mercredi 29 juillet 2015
How to Remove istartpageing.com?
Top Things To Consider When Contracting an IOS App Development Company
"BUFFET HUT"-A Complete Dine-In Place
Your Cell phone Needs Help - Let's Repair It!
Choose CNC Rapid Prototyping Services For Faster and Automatic Production
6 Surprising Facts about Dry Cleaning
Maintain optimum temperature with warehouse temperature monitoring
Designing the Perfect Seaside Home
5 Ways To Get Even Better Work Out Of Your Advertising Agency
Three Things You Should Know about Domestic Violence
10 Compatibility Factors For Hindu Marriage
The Urban Myth of Newsletter Provider Deliverability Rates
How to Protect Yourself from All These Adobe Flash 0-Day Security Holes
Share your knowledge via digital magazine
Pros and Cons of Wood Laminate Flooring for Your Home
Give a Completely Latest Finger to Your Premises with Designer Furniture
Techpreneur Piyush Agrawal wins entrepreneur of the year for education services
Evolution of Online Shopping
How to Choose the Best Garage Door Repair Service
The Growth of Robotics In STEM Education
Download process of SSC CGL 2015 Admit Card
Download Files From the Internet with Arovax Technical Support
Types of Mobile Apps
Biologics for Crohn's disease: Benefits and risks
Constructive benefits of certified domain name registration
Why Is Sydney Picture Booth Employ Now Necessary for Occasions?
Study Abroad in New Zealand-Application,Cost & Requirements
mardi 28 juillet 2015
The Quiet Tale of Successful South African Immigration to the US
Green Card Lottery Demand Gets Stronger in 2015
GUSGC unveils new web application for DV Lottery applicants
vendredi 17 juillet 2015
ECommerce branding - in search of identity
lundi 13 juillet 2015
Application Save SEARCH ENGINE MARKETING Expert services Providers
How To Choose The Correct Size Of Men's Swimwear
Get beautiful mane with hair salons in Dubai
Learning Vibrato on Your Violin Lessons
You Can't Beat Some Good Lean Posters
University College Dublin – Best Ireland University
Apple Mac laptop
Top Guides of Zombie Assault: Sniper That You Should Know
Use These Car Accessories to Give Your Car a Magical Makeover
Call our toll free number for AVG support and get complete solution to your AVG issues
Use Of Royalty Free Music In Different Applications
How can the Live Mail clients keep the technical problems at bay?
jeudi 9 juillet 2015
Flat Belly Diet: Start Your Flat Belly Diet Today
How Seamless Professional Website Design Is Important For Webmasters On The Internet?
Use Royalty Free Music For Multimedia Applications, Film Production And Promotional Activities
Softphone software does n't require a typical teephonic hardware
SEO Tips to Boost Mobile App Download
Buying ISO Containers from Online Container Suppliers is More Convenient
Choosing the Best Rakhi Gift
Stay in the Comfort of Condos in Edmonton at Affordable Rates
Extra-intestinal symptoms to be noted during IBD diagnosis
Security and Information Downloads
How to Overcome Stress and Tensions Amid Exams
Kill Boredom with These Weekend Getaways from Hyderabad
How Designers Can Earn Money
Download Access recovery Tool
IAS Admit Card- to be release in the end of July
Business Surveys, A Key Step To Drive More Profit Your Company
7 Steps To Set Up Your Own Online Business
Advantages of Outsourcing IT Service for Any Business
Online Training in MongoDB Administration in Hyderabad
Top Guides of Sniper 3D Assassin: Shoot to Kill You Can Not Miss
The Most Popular Cemetery Flowers
Repair body and mind with the Dubai Spa Massage
10 Signs You Should Start Investing In Your Employee Referral Program
5 Types of Mobile Apps for a Productive Content Marketer
The App Development Sector and Some Staggering Figures Related to It
M.SC. in Anatomy from best Medical College in India
Improved organizational efficiency at the drop of a hat
Online Professional Courses And Training: Benefits Of Professional Courses And Training Offered Online
Squat Stool For Making Squatting Toilet Review
The various kinds of Ordinary visa to China and their features
Freight Shipping Tools & The Advantage of Freight Online Quotes
The Search for the Elusive UK Visa can be Ended
lundi 6 juillet 2015
What is Wrong With Writing Down Your Password?
The International Way to Learn About Remove McAfee
7 tefl websites
Diamonds Are for years
Free Gemstones: Some Intriguing Facts
Why Diamonds Are Better Than Other Precious Stones
A Brief Guide About Ios App Development
How To Check And Update The Joomla Version Of Your Website?
Ecommerce Website Development- Best Platforms
Jim Corbett National Park- Eye shot the mesmerizing Flora and Fauna
Useful Empires & Allies Cheats Without Spending Money
Tips to Choose the Best Airsoft Gun
Your Guide to the New Mazda CX-9
Five Men Accessories that are must Haves
Do you want to outsource your Ecommerce website design to India?
Catch your favorite game in nearby sports bar
Fence and Deck Service to Enhance Your Private or Commercial Space
Evaporative Coolers - Perfect Solution For Summer
Online Exam Generators For Pumping Your Skills Faster
Enhance Your Feminism With Libido Plus For Women
10 Reasons why Blogging Should Top Your Marketing To-Do List
What Function is Needed When You Choose a Car DVD Player?
Managing Kids Online Experience
Secret To Fast Weight Loss: This Is Possibly The Best Secret To Fast Weight Loss
Real Estate Professionals - bad and Good points in Listing Commercial Property Right now
Fast Weight Loss Diet Plan: If You Follow The Guidelines To A Fast Weight Loss Diet Plan You Can Lose Weight
10 Should-Know Professional Real Estate Property Terminology
Industrial Real Estate Brokers - What you ought to Know About This Industry
5 Methods for Creating a Catalog That Hard disks Income
Internet Advertising Recommendations and techniques for Local Businesses
Benefits of Catalog Advertising and marketing
Be Quick And Get The Most Out Of Your Smartphones With Micro USB High Speed Charge Cable
Mobile App Testing Company Provide Error Free Application
What is a logo and what does it do?
Captioning On Glass Application Is The New In Thing From Google Glasses Applications Development Team
Uninterrupted Vodafone Online Recharge Services at Reload
What you need to Master Your New Smartphone
Customer Behavior - What does it Actually Teach?
How to pick out a dependable IT Support provider for your company in Seattle?
Increase Your Energy With Men Libido Booster Supplements
What is the best way of finding VPN services?
Financial Companies open the Funding Tap for Infrastructure Developments
Designer Saree: Perfect To Wear On Lavishing Weddings
jeudi 2 juillet 2015
The Hottest Accessory of a Hot Summer: Wholesale Scarves
All about Promoting Event Apps
Read This If You Are A New Flute Teacher
10 Ways to Boost Your Facebook Business Page
The perks associated with studying abroad in Russia
14 Fourth of July Beach Party Essentials Every Mom Will Be Thankful For
Excellent Temple Run 2 Cheats That You Should Know
Digital Restaurant Food Menu offers Full Restaurant Digital Services with Solutions
You Can Download The Latest Music From Your Favorite Artist
Digital Marketing: A Real Pedestal For Business Growth
Enjoy Parenthood With These 8 Gadgets For Parents
Wedding Venues: Separating the Good from the Bad
Fabricate YOUR SELF Regard, A STARTER Manual for SELF Change
10 inquiries you ought to ask to yourself
Anti Aging, Skin Care, Sun Exposure and Medications
3 Amazing Severe Sports activities
Pune properties ensures exemplary investment returns
Switching to Hosted Exchange, you get better control of your costs reducing the need for expensive hardware installations and ongoing maintenance
dimanche 19 avril 2015
How to implement background script to an html page
I have a javascript that draws pattern as users use my site. I want this script to be implemented in the back of an html page that I can add the top layer content to. So pattern drawn on mouse movement should be background of my html page. I tried with transparent div but in this case active dicv would be trasparent(div) but my pattern is in background so it cant track mouse moves. please suggest any solution
codeigniter : getting ajax result issues
i have this simple exams system and i want to use ajax when a user answer
this is my form :
when i use action="<*?=site_url("exams/check_answer")?>" it gives 302 error
<form action="<?=site_url('exams/'.$result->id.'/check_answer');?>" method="post" id="answer-exam-frm">
<div>
<p><input type="radio" name="response" value="first"><span class="choice-exam"><?php echo $result->choice1;?></span></p>
<p><input type="radio" name="response" value="second"><span class="choice-exam"><?php echo $result->choice2;?></span></p>
<p><input type="radio" name="response" value="third"><span class="choice-exam"><?php echo $result->choice3;?></span></p>
<input type="hidden" name="examid" value="<?php echo $result->id;?>">
<input type="submit" class="btn btn-default" value="اجابة">
</div>
</form>
this is my controller :
public function check_answer(){
$user_answer = $this->input->post('response') ;
$exam_id = $this->input->post('examid') ;
$result = $this->style_model->check_answer($user_answer,$exam_id) ;
$this->output->set_content_type('application/json') ;
if($result){
$this->output->set_output(json_encode(['result' => 1 ])) ;
return false;
}
$this->output->set_output(json_encode(['result' => 0 ])) ;
}
And this is my model :
public function check_answer($user_answer,$exam_id)
{
$this->db->where('response' , $user_answer);
$this->db->where('id' , $exam_id);
$get = $this->db->get('exam') ;
return $get->result() ;
}
Increase Font Size in Bootstrap?
Is it possible to increase font size in Bootstrap? A functionality to allow the user to increase the font of the whole website.
Is this possible? If there is a way to manually increase the font-size will be helpful too instead of the automated way.
Find a jQuery dialog by its title
I previously created a jQuery dialog like this:
dialog.dialog({
title: 'Hello',
closeOnEscape: true,
width: "auto",
maxWidth: "500",
close: function(event, ui) { dialog.remove(); }
});
Now I need to check if some dialog with the title 'Hello' exists.
How can I do that?
Thanks.
Return a Radio Button Value in MeteorJs
I am trying to follow this tutorial to implement a, in my case, radio button. I am iterating over the categories but in my case, Job Types:
Views:
<label>Category</label>
{{#each jobTypes}}
<label class="checkbox inline">
<input id="jobType_{{_id}}" type="radio" value="{{_id}}" name="jobType" {{hasJobType}} /> {{name}}
</label>
{{/each}}
My Submit js:
Template.jobCreate.events({
'submit form': function(e) {
e.preventDefault();
var job = {
jobTitle: $(e.target).find('[name=jobTitle]').val(),
aboutRole: $(e.target).find('[name=aboutRole]').val(),
howToApply: $(e.target).find('[name=howToApply]').val(),
aboutCandidate: $(e.target).find('[name=aboutCandidate]').val(),
benefits: $(e.target).find('[name=benefits]').val(),
// for the radio button. This feels wrong:
jobTypes: $(e.target).find('input[name=jobType]:checked').val(),
};
Meteor.call('jobInsert', job, function(error, result) {
// display the error to the user and abort
if (error)
return alert(error.reason);
Router.go('jobPage', {_id: result._id});
});
}
});
My helper js:
Template.jobCreate.helpers({
hasJobType: function() {
return _.contains(job.jobTypes, this.name) ? 'checked' : '';
}
});
If I echo return {{jobTypes}}, I get the radio button _id but if I replace value {{_id}} with {{name}}, in the views, I get the name but the tutorial uses the id instead. Am I missing something is my js?
I have yet to implement an edit/delete js.
jQuery Taggd plugin (Edit mode) get back value in input fields
Im using the jQuery taggd plugin, so far so good. I modified a small bit, im using it in edit mode. So when a user types in a value in the textbox it checks if it is a URL or or string, if its a URL it runs a ajax call to a php file which scrapes some data from the url. Url title, description and image. I have created 3 hidden input fields which get populated once the ajax call is finished. Once you click on the SAVE icon it saves the data to the DOM. But i want it to display again once a user clicks on the tag again. At the moment its only displaying the value of the standard input field.
This is the taggd plugin with some small modifications:
/*!
* jQuery Taggd
* A helpful plugin that helps you adding 'tags' on images.
*
* License: MIT
*/
(function($) {
'use strict';
var defaults = {
edit: false,
align: {
x: 'center',
y: 'center'
},
handlers: {},
offset: {
left: 0,
top: 0
},
strings: {
save: '✓',
delete: '×'
}
};
var methods = {
show: function() {
var $this = $(this),
$label = $this.next();
$this.addClass('active');
$label.addClass('show').find('input').focus();
},
hide: function() {
var $this = $(this);
$this.removeClass('active');
$this.next().removeClass('show');
},
toggle: function() {
var $hover = $(this).next();
if($hover.hasClass('show')) {
methods.hide.call(this);
} else {
methods.show.call(this);
}
}
};
/****************************************************************
* TAGGD
****************************************************************/
var Taggd = function(element, options, data) {
var _this = this;
if(options.edit) {
options.handlers = {
click: function() {
_this.hide();
methods.show.call(this);
}
};
}
this.element = $(element);
this.options = $.extend(true, {}, defaults, options);
this.data = data;
this.initialized = false;
if(!this.element.height() || !this.element.width()) {
this.element.on('load', _this.initialize.bind(this));
} else this.initialize();
};
/****************************************************************
* INITIALISATION
****************************************************************/
Taggd.prototype.initialize = function() {
var _this = this;
this.initialized = true;
this.initWrapper();
this.addDOM();
if(this.options.edit) {
this.element.on('click', function(e) {
var poffset = $(this).parent().offset(),
x = (e.pageX - poffset.left) / _this.element.width(),
y = (e.pageY - poffset.top) / _this.element.height();
_this.addData({
x: x,
y: y,
text: '',
url: '',
url_title: '',
url_description: '',
url_image: ''
});
_this.show(_this.data.length - 1);
});
}
$(window).resize(function() {
_this.updateDOM();
});
};
Taggd.prototype.initWrapper = function() {
var wrapper = $('<div class="taggd-wrapper" />');
this.element.wrap(wrapper);
this.wrapper = this.element.parent('.taggd-wrapper');
};
Taggd.prototype.alterDOM = function() {
var _this = this;
this.wrapper.find('.taggd-item-hover').each(function() {
var $e = $(this),
$input = $('<input id="url" type="text" size="16" />')
.val($e.text()),
$url_title = $('<input type="text" id="url_title" class="url_title" />'),
$button_ok = $('<button />')
.html(_this.options.strings.save),
$url_description = $('<input type="text" class="url_description" id="url_description" />'),
$url_image = $('<input type="text" class="url_img" id="url_img" />'),
$url_preview = $('<div id="content"></div>'),
$button_delete = $('<button />')
.html(_this.options.strings.delete);
$button_delete.on('click', function() {
var x = $e.attr('data-x'),
y = $e.attr('data-y');
_this.data = $.grep(_this.data, function(v) {
return v.x != x || v.y != y;
});
_this.addDOM();
_this.element.triggerHandler('change');
});
// Typing URL timer
var typingTimer;
var doneTypingInterval = 2000;
$input.keyup(function() {
clearTimeout(typingTimer);
typingTimer = setTimeout(doneTyping, doneTypingInterval);
});
$input.keydown(function() {
clearTimeout(typingTimer);
$url_preview.empty();
});
// Process URL scrape request
function doneTyping() {
var getUrl = $input.val();
if(isURL(getUrl)) {
console.log('Typed text is a URL');
$url_preview.append('<img src="images/loader.gif" style="width:24px; padding-top:10px; height:24px; margin:0 auto;">');
// Get url data by ajax
$.post('ajax/Crawl.php', {
'url' : getUrl
},function(data) {
$url_preview.empty();
var content = '<h3 class="url_title">' + data.title + '</h3><p class="url_description" style="font-size:11px;">' + data.description + '</p><img class="url_image" src="' + data.images + '" style="width:100%; height:auto;">';
$url_preview.append(content);
$url_title.val(data.title);
$url_description.val(data.description);
$url_image.val(data.images);
console.log(content);
}, 'json');
} else {
console.log('Typed text is a string');
}
};
function isURL(url) {
var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
'(\\#[-a-z\\d_]*)?$','i'); // fragment locator
if(!pattern.test(url)) {
return false;
} else {
if(!/^(https?|ftp):\/\//i.test(url)) {
url = 'http://'+url;
$input.val(url);
}
return true;
}
};
$button_ok.on('click', function() {
var x = $e.attr('data-x'),
y = $e.attr('data-y'),
item = $.grep(_this.data, function(v) {
return v.x == x && v.y == y;
}).pop();
if(item) item.text = $input.val();
if(isURL(item.text)) {
if(item) item.url = item.text;
} else {
if(item) item.url = null;
}
if(item) item.url_title = $url_title.val();
if(item) item.url_description = $url_description.val();
if(item) item.url_image = $url_image.val();
_this.addDOM();
_this.element.triggerHandler('change');
//_this.hide();
});
/*$input.on('change', function() {
var x = $e.attr('data-x'),
y = $e.attr('data-y'),
item = $.grep(_this.data, function(v) {
return v.x == x && v.y == y;
}).pop();
if(item) item.text = $input.val();
_this.addDOM();
_this.element.triggerHandler('change');
});
*/
$e.empty().append($input, $button_ok, $button_delete, $url_preview, $url_title, $url_description, $url_image);
});
_this.updateDOM();
};
/****************************************************************
* DATA MANAGEMENT
****************************************************************/
Taggd.prototype.addData = function(data) {
if($.isArray(data)) {
this.data = $.merge(this.data, data);
} else {
this.data.push(data);
}
if(this.initialized) {
this.addDOM();
this.element.triggerHandler('change');
}
};
Taggd.prototype.setData = function(data) {
this.data = data;
if(this.initialized) {
this.addDOM();
}
};
Taggd.prototype.clear = function() {
if(!this.initialized) return;
this.wrapper.find('.taggd-item, .taggd-item-hover').remove();
};
/****************************************************************
* EVENTS
****************************************************************/
Taggd.prototype.on = function(event, handler) {
if(
typeof event !== 'string' ||
typeof handler !== 'function'
) return;
this.element.on(event, handler);
};
/****************************************************************
* TAGS MANAGEMENT
****************************************************************/
Taggd.prototype.iterateTags = function(a, yep) {
var func;
if($.isNumeric(a)) {
func = function(i, e) { return a === i; };
} else if(typeof a === 'string') {
func = function(i, e) { return $(e).is(a); }
} else if($.isArray(a)) {
func = function(i, e) {
var $e = $(e);
var result = false;
$.each(a, function(ai, ae) {
if(
i === ai ||
e === ae ||
$e.is(ae)
) {
result = true;
return false;
}
});
return result;
}
} else if(typeof a === 'object') {
func = function(i, e) {
var $e = $(e);
return $e.is(a);
};
} else if($.isFunction(a)) {
func = a;
} else if(!a) {
func = function() { return true; }
} else return this;
this.wrapper.find('.taggd-item').each(function(i, e) {
if(typeof yep === 'function' && func.call(this, i, e)) {
yep.call(this, i, e);
}
});
return this;
};
Taggd.prototype.show = function(a) {
return this.iterateTags(a, methods.show);
};
Taggd.prototype.hide = function(a) {
return this.iterateTags(a, methods.hide);
};
Taggd.prototype.toggle = function(a) {
return this.iterateTags(a, methods.toggle);
};
/****************************************************************
* CLEANING UP
****************************************************************/
Taggd.prototype.dispose = function() {
this.clear();
this.element.unwrap(this.wrapper);
};
/****************************************************************
* SEMI-PRIVATE
****************************************************************/
Taggd.prototype.addDOM = function() {
var _this = this;
this.clear();
this.element.css({ height: 'auto', width: 'auto' });
var height = this.element.height();
var width = this.element.width();
$.each(this.data, function(i, v) {
var $item = $('<span />');
var $hover;
if(
v.x > 1 && v.x % 1 === 0 &&
v.y > 1 && v.y % 1 === 0
) {
v.x = v.x / width;
v.y = v.y / height;
}
if(typeof v.attributes === 'object') {
$item.attr(v.attributes);
}
$item.attr({
'data-x': v.x,
'data-y': v.y
});
$item.css('position', 'absolute');
$item.addClass('taggd-item');
_this.wrapper.append($item);
if(typeof v.text === 'string' && (v.text.length > 0 || _this.options.edit)) {
$hover = $('<span class="taggd-item-hover" style="position: absolute;" />').html(v.text);
$hover.attr({
'data-x': v.x,
'data-y': v.y
});
_this.wrapper.append($hover);
}
if(typeof _this.options.handlers === 'object') {
$.each(_this.options.handlers, function(event, func) {
var handler;
if(typeof func === 'string' && methods[func]) {
handler = methods[func];
} else if(typeof func === 'function') {
handler = func;
}
$item.on(event, function(e) {
if(!handler) return;
handler.call($item, e, _this.data[i]);
});
});
}
});
this.element.removeAttr('style');
if(this.options.edit) {
this.alterDOM();
}
this.updateDOM();
};
Taggd.prototype.updateDOM = function() {
var _this = this;
this.wrapper.removeAttr('style').css({
height: this.element.height(),
width: this.element.width()
});
this.wrapper.find('span').each(function(i, e) {
var $el = $(e);
var left = $el.attr('data-x') * _this.element.width();
var top = $el.attr('data-y') * _this.element.height();
if($el.hasClass('taggd-item')) {
$el.css({
left: left - $el.outerWidth(true) / 2,
top: top - $el.outerHeight(true) / 2
});
} else if($el.hasClass('taggd-item-hover')) {
if(_this.options.align.x === 'center') {
left -= $el.outerWidth(true) / 2;
} else if(_this.options.align.x === 'right') {
left -= $el.outerWidth(true);
}
if(_this.options.align.y === 'center') {
top -= $el.outerHeight(true) / 2;
} else if(_this.options.align.y === 'bottom') {
top -= $el.outerHeight(true);
}
$el.attr('data-align', $el.outerWidth(true));
$el.css({
left: left + _this.options.offset.left,
top: top + _this.options.offset.top
});
}
});
};
/****************************************************************
* JQUERY LINK
****************************************************************/
$.fn.taggd = function(options, data) {
return new Taggd(this, options, data);
};
})(jQuery);
I thought this would do what i want, since it works with the standard text input box, using .val($e.text()), works fine but as soon as i do the same to the url_title box, for example .val($e.url_title()), i get the error below.
$input = $('<input id="url" type="text" size="16" />')
.val($e.text()),
$url_title = $('<input type="text" id="url_title" class="url_title" />'),
$button_ok = $('<button />')
.html(_this.options.strings.save),
$url_description = $('<input type="text" class="url_description" id="url_description" />'),
$url_image = $('<input type="text" class="url_img" id="url_img" />'),
$url_preview = $('<div id="content"></div>'),
$button_delete = $('<button />')
.html(_this.options.strings.delete);
But if for example i change the $url_title to
$url_title = $('<input type="text" id="url_title" class="url_title" />').val($e.url_title()),
I get a error back in the console: Uncaught TypeError: undefined is not a function
This is the init code on the main page:
$(document).ready(function() {
var options = {
edit: true,
align: {
y: 'top'
},
offset: {
top: 15
},
handlers: {
//mouseenter: 'show',
click: 'toggle'
}
};
/*var data = [
{ x: 0.22870478413068845, y: 0.41821946169772256, text: 'Eye' },
{ x: 0.51, y: 0.5, text: 'Bird' },
{ x: 0.40, y: 0.3, text: 'Water, obviously' }
];*/
var data = [];
var taggd = $('.taggd').taggd( options, data );
taggd.on('change', function() {
console.log(taggd.data);
});
});
In the console log it logs the values fine:
[Object]0: Objecttext: "http://ift.tt/gbk8l4"url: "http://ift.tt/gbk8l4"url_description: "Q&A for professional and enthusiast programmers"url_image: "http://ift.tt/1HGxN5r"url_title: "Stack Overflow"x: 0.41141586360266863y: 0.19444444444444445
I hope someone can shine a light on it and point me in the right direction of what i'm doing wrong.
To simplify it, i want to be able to have a title input and a description input for my tags, how would i achieve this?
Thank you.
Google Pie chart tooltip z-index
I have a google pie chart where tooltips are rendered behind an adjacent image.
How can I make sure the tooltips are displayed on top? I have set 0 for the image z-index, 10 for the chart overall z-index but it's not working.
Here in image :
Javascript Edit-Delete Function from a looped Textbox with Values
I am new to web development and I am trying to add an add/edit/delete function to my displayed form values using Javascript. Well, I cant really find the words to explain but this is what Im trying to accomplish.
I have this loop that lists discounts from a database:
@foreach (var discount in Model.Discounts)
{
<div class="editor-label">
<label for="@discount.Key.DiscountCode">@discount.Key.DiscountName</label>
</div>
<div class="editor-field">
<input class="@discount.Key.DiscountCode" name="@discount.Key.DiscountCode" readonly="true" type="text" />
<a class="remove" data-key="@discount.Key.DiscountCode" href="javascript:void(0);">Remove</a>
<a class="edit" data-key="@discount.Key.DiscountCode" href="javascript:void(0);">Edit</a>
</div> <br />
}
<a class="add-discount" href="javascript:void(0);">Add Discount</a>
As you can imagine this will loop into this kind of output:
Label1 [Textbox for Label1] Delete Edit
Label2 [Textbox for Label2] Delete Edit
Label3 [Textbox for Label3] Delete Edit
How can I make these commands work using javascript/jquery.
Please note that the delete/edit function only applies to the displayed data and not the database. what I meant is if I click Delete, it will delete its corresponding Label and Textbox from the display only and not in the database, also when Edit is clicked, it will only enable the textbox to alter the data inside it.
Any help will be greatly appreciated. Thank you so much!!
I am using Visual Studio 2013 and developing this using ASP.NET MVC4
Angular-js: ng-repeat on a select element with a attribute directive
I have a directive on a element called on-change. The idea is when the selected value changes it gets saved in a scope variable and then another element picks it up.
My problem is if the elements of the are static the above works fine but if I use ng-repeat, the onchange stops working.
<select on-change="myvar" ng-repeat="(key, value) in dataset">
<option value="{{key}}">{{value.name}}</option>
</select>
here's my onchange directive:
.directive('onChange', function() {
return {
restrict: 'A',
scope:{'onChange':'=' },
link: function(scope, elm, attrs) {
scope.$watch('onChange', function(nVal) { elm.val(nVal); });
elm.bind('blur', function() {
var currentValue = elm.val();
if( scope.onChange !== currentValue ) {
scope.$apply(function() {
scope.onChange = currentValue;
});
}
});
}
};
})
Any idea's on how I can overcome this issue?
Thanks
How to use free jqgrid properties to conditionally add actions buttons
free jqgrid shows orders. Posted orders should have yellow background and only open action button. Unposted orders shoudl have white button and also standard delete and custom post action button:
colmodel for actions column:
{"hidden":false,"label":"Activity","name":"_actions","search":false,"width":94
,"sortable":false,"formatter":"actions","viewable":false,"formatoptions":{"editbutton":false,"onSuccess":function (jqXHR) { jqXHRFromOnSuccess=jqXHR;return true;}
,"delbutton":true,"delOptions":{"url":"http://localhost:52216/admin/Grid/Delete?_entity=DoklstlT","afterComplete":function (response, postdata, formid) {
summarefresh($grid);
$grid[0].focus();
}
}}},
posted state is detemined by boolean Kinnitatud column :
{"label":null,"name":"Kinnitatud","index":"Kinnitatud","editoptions":{"value":"True:False","readonly":"readonly","disabled":"disabled"},"template":"booleanCheckboxFa","editable":true,"width":0,"classes":null,"hidden":true,"searchoptions":{"sopt":["eq","ne"],"value":":Free;true:Yes;false:No"},"dataEvents":[{"type":"focus","fn":function(e) {if(typeof e.target.ischanged=='undefined') {e.target.ischanged=false}}
},"",{"type":"click","fn":function(e) {dataChanged(e.target)}
},{"type":"blur","fn":function(e) {summarefresh()}
}]}],
in other grid posted state is determined by Kinkuup column which is not filled for unposted documents:
{"template":DateTemplate
,"label":null,"name":"Kinkuup","index":"Kinkuup","editoptions":{"dataInit":null,"size":10,"readonly":"readonly","disabled":"disabled"},"searchoptions":{"dataInit":initDateSearch
,"size":10,"attr":{"size":10}},"width":0,"classes":null,"hidden":true,"dataEvents":[]}],
Both columns can hidden or visible in grid. depending on user preferences.
Custom actions buttons are created in loadComplete for all rows:
loadComplete: function() {
var iCol = getColumnIndexByName($(this),'_actions');
$(this).children("tbody").children("tr.jqgrow")
.children("td:nth-child("+(iCol+1)+")")
.each(function() {
$("<div>",
{
title: "Confirm (F2)",
mouseover: function() {
$(this).addClass('ui-state-hover');
},
mouseout: function() {
$(this).removeClass('ui-state-hover');
},
click: function(e) {
resetSelection();
idsOfSelectedRows = [$(e.target).closest("tr.jqgrow").attr("id")];
$("#grid").jqGrid('setSelection', $(e.target).closest("tr.jqgrow").attr("id"), false);
$('#grid_postbutton').click();
}
}
)
.addClass("ui-pg-div ui-inline-post")
.append('<span class="fa ui-state-default fa-fw fa-lock"></span>')
.prependTo($(this).children("div"));
$("<div>",
{
title: "Open (Enter)",
mouseover: function() {
$(this).addClass('ui-state-hover');
},
mouseout: function() {
$(this).removeClass('ui-state-hover');
},
click: function(e) {
openDetail($(e.target).closest("tr.jqgrow").attr("id"));
}
}
)
.addClass("ui-pg-div ui-inline-open")
.append('<span class="fa ui-state-default fa-folder-open-o"></span>')
.prependTo($(this).children("div"));
});
After that buttons are conditionally removed using code from How to remove action buttons from posted rows in free jqgrid using Fontawesome checkbox formatter
disableRows('Kinkuup', false);
disableRows('Kinnitatud', true);
var disableRows = function (rowName, isBoolean) {
var iCol = getColumnIndexByName($grid, rowName),
cRows = $grid[0].rows.length,
iRow,
row,
className,
isPosted,
mycell,
mycelldata,
cm = $grid.jqGrid('getGridParam', 'colModel'),
iActionsCol = getColumnIndexByName($grid, '_actions'), l,
isPostedStr;
l = cm.length;
for (iRow = 0; iRow < cRows; iRow = iRow + 1) {
row = $grid[0].rows[iRow];
className = row.className;
if ($(row).hasClass('jqgrow')) {
isPostedStr = $.unformat.call($grid[0], row.cells[iCol],
{ rowId: row.id, colModel: cm[iCol] }, iCol);
//if (cm[iCol].convertOnSave) {
// isPosted = cm[iCol].convertOnSave.call(this, {
// newValue: isPostedStr,
// cm: cm[iCol],
// oldValue: isPostedStr,
// id: row.id,
// //item: $grid.jqGrid("getLocalRow", row.id),
// iCol: iCol
// });
//}
isPosted = isPostedStr !== "False" && isPostedStr.trim() !== "";
if (isPosted) {
if ($.inArray('jqgrid-postedrow', className.split(' ')) === -1) {
// todo: how to disable actions buttons and form editing:
row.className = className + ' jqgrid-postedrow not-editable-row';
$(row.cells[iActionsCol]).attr('editable', '0');
$(row.cells[iActionsCol]).find(">div>div.ui-inline-del").hide();
$(row.cells[iActionsCol]).find(">div>div.ui-inline-post").hide();
$(row.cells[iActionsCol]).find(">div>div.ui-inline-edit").hide();
}
}
}
}
};
How to use free jqgrid actions options to simplify this code ?
Someone is claiming they wrote this code [on hold]
I'm close to releasing my app and my friend added the collision-detection code in the beginning. If this looks familiar please let me know:
function collides(a, b) {
var aTop = a.offset().top;
var aLeft = a.offset().left;
var bTop = b.offset().top;
var bLeft = b.offset().left;
return !(
((aTop + a.height()) < (bTop)) ||
(aTop > (bTop + b.height())) ||
((aLeft + a.width()) < bLeft) ||
(aLeft > (bLeft + b.width()))
);
}
//colliding stuff and responce.
function handleCollisions() {
if (collides($('#firstObs'),$('#player'))) {
$('#levelOne').stop();
$('#player').css('border', 'solid 1px red');
}
else { // if not collision
$('#player').html("<p></p>");
}
}
Is there a source on the web that he might of got this code from, to prove he did write it himself?