Skip to content

Instantly share code, notes, and snippets.

View rlodina's full-sized avatar

Radu Lodina rlodina

  • Baia Mare, Romania
View GitHub Profile
// Tested with 1.0.0-pre.2, 0.9.7 or less does not work.
// Chosen modified to search on @results_data[n].text not .html
App.ChosenMultipleSelect = Em.Select.extend({
multiple: true,
attributeBindings: [ 'multiple' ],
didInsertElement: function() {
this._super();
this.$().chosen();
},
// This implementation assumes a router that calls connectOutlet on the current parent view's controller along the lines of:
// newThingController.connectOutlet({
// name: 'chosenSelect'
// })
//
//...which in turn assumes you've got App.ChosenSelectController with the sorting mixin along the lines of:
// App.ChosenSelectController = Ember.ArrayController.extend({
// content: App.store.findAll(App.Client),
// sortProperties: ['name'],
// sortAscending: true
/**
* Parse the given operator `str`.
*
* @param {String} str
* @return {Array}
* @api public
*/
module.exports = function(str){
DS.BlankAdapter = DS.Adapter.extend({
bulkCommit: false,
since: 'since',
serializer: DS.BlankSerializer,
init: function() {
},
/**
* Email matcher.
*/
exports.emailRegex = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/;
exports.urlRegex = /^(?!mailto:)(?:(?:https?|ftp):\/\/)?(?:\S+(?::\S*)?@)?(?:(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))|localhost)(?::\d{2,5})?(?:\/[^\s]*)?$/i;
exports.urlMaxLength = 2083;
/*jshint browser:true */
/*global DS:true, io:true, App:true */
(function() {
'use strict';
// Initializer for Models
window.Models = {};
console.warn("Don't pollute the global namespace with Models!");
var get = Ember.get;
/**
@extends Ember.Mixin
Implements common pagination management properties for controllers.
*/
Ember.PaginationSupport = Ember.Mixin.create({
/**
*/
@rlodina
rlodina / index.html
Created June 28, 2012 19:26
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>(CSS3) Unfold Map with Pins &middot; CodePen</title>
<style>