Skip to content

Instantly share code, notes, and snippets.

View hilukasz's full-sized avatar

Łukasz Wieczorek hilukasz

View GitHub Profile
!!! 5
html
head
title= title
- each tag in meta
meta(name= tag.name, content= tag.content, charset= tag.charset)
link(rel='stylesheet', href='http://fonts.googleapis.com/css?family=Muli' )
link(rel='stylesheet', href='/css/styles.css' )
body(class=pageClass)
function doActionOnLayer(layerName, functionName) {
for (var i = 0; i < numberOfLayers; i++) {
var customName = layerName; //layerName should be string
var myLayer = app.activeDocument.layers[i];
var myLayer = myLayer.name;
if (customName == myLayer) {
var myLayerIndex = i;
return myLayerIndex;
functionName;
}
//not even sure if I can do this? should I declare each var for each value?
var newSalesPageInputs = [$newSaleAddress = $('#newSaleAddress'),
$newSaleAddress = $('#newSaleAddress'),
$newSaleTitle = $('#newSaleTitle'),
$newSaleDescription = $('#newSaleDescription'),
$newSaleSummary = $('#newSaleSummary'),
$newSaleItems = $('#newSaleItems')];
for (var i = 0; i < newSalesPageInputs.length; i++) {
alert(i);
var newSalesPageInputs = [var $newSaleAddress = $('#newSaleAddress'),
var $newSaleTitle = $('#newSaleTitle'),
var $newSaleDescription = $('#newSaleDescription'),
var $newSaleSummary = $('#newSaleSummary'),
var $newSaleItems = $('#newSaleItems')];
for(var i = 0; i < newSalesPageInputs.length; i++) {
alert(i);
$('.inputFocus').each( function(){
var clearMePrevious;
var c = 0;
$(this).keypress(function() {
if (c == 0) {
clearMePrevious = $(this).val();
$(this).val('');
c++;
}
var myString;
var myStringLine;
var thePath = File.openDialog();
//alert(thePath);
function readPref (thePath) {
if (File(thePath).exists == true) {
var file = File(thePath);
//alert("file :: "+file);
file.open("r");
file.encoding= 'BINARY';
var currentOpenItem,
lastOpenItem,
isOpen = false,
myHeight = 44,
headerNav = $('.header-nav'),
closeDiv = $('#close');
$(".team .thumb").show();
// close .header-nav bar
$('#menu-item-653').click(function() {
function mySymbol(input){
var idoc = app.activeDocument;
if (input <= idoc.symbolItems.length-1) {
alert(idoc.symbolItems.length);
if (input) {
this.mySymbolIndex = input;
} else { this.mySymbolIndex = 0; }; //set up default symbol to first one if none is defined
this.width = function () {
var symbolWidth = Math.round(idoc.symbolItems[this.mySymbolIndex].width); //convert float to int
return symbolWidth;
@hilukasz
hilukasz / second javascript
Created May 24, 2012 22:14
first javascript
unction MySymbol(input){
this.doc = app.activeDocument;
this.mySymbolIndex = input || 0;
}
MySymbol.prototype.hasSymbolIndex = function() {
return this.mySymbolIndex <= this.doc.symbolItems.length - 1;
};
MySymbol.prototype.width = function() {
function MySymbol(input){
this.doc = app.activeDocument;
this.mySymbolIndex = input || 0;
this.mySymbolItem = this.hasSymbolIndex() ? this.doc.symbolItems[this.mySymbolIndex] : false;
}
MySymbol.prototype.hasSymbolIndex = function() {
return this.mySymbolIndex <= this.doc.symbolItems.length - 1;
};