view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Parser/Ini.pm view on Meta::CPAN
Syntactically, I<VALUE> is anything to the right of the equals sign and up
to the linefeed character terminating the line (ASCII 10), not including
the leading and trailing whitespace characters.
Each setting occupies one line. Very long lines can be split over several
physical lines by ending each line fragment except the last with a backslash
character appearing right before the linefeed character.
A I<section> begins with a section declaration in the following form:
[NAME NAME...]
lib/Config/Parser/Ini.pm view on Meta::CPAN
them with a single backslash.
The B<Config::Parser::Ini> module is a framework for parsing such files.
In the simplest case, the usage of this module is as simple as in the following
fragment:
use Config::Parser::Ini;
my $cf = new Config::Parser::Ini(filename => "config.ini");
On success, this returns a valid B<Config::Parser::Ini> object. On error,
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Spiffy.pm view on Meta::CPAN
? '{}'
: default_as_code($default);
my $code = $code{sub_start};
if ($args->{-init}) {
my $fragment = $args->{-weak} ? $code{weak_init} : $code{init};
$code .= sprintf $fragment, $field, $args->{-init}, ($field) x 4;
}
$code .= sprintf $code{set_default}, $field, $default_string, $field
if defined $default;
$code .= sprintf $code{return_if_get}, $field;
$code .= sprintf $code{set}, $field;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Record.pm view on Meta::CPAN
push @key, $_;
}
my $entry = $self->{record};
my $context;
foreach my $fragment (@key) {
$context = defined $context ? $context . "/" . $fragment : $fragment;
if ($fragment =~ /^\[(\d+)\]$/) {
my $index = $1;
if (ref($entry) ne "ARRAY") {
if (@_) {
return shift;
}
lib/Config/Record.pm view on Meta::CPAN
}
confess "cannot find array value at '$context' for parameter '$key'";
}
$entry = $entry->[$index];
} elsif ($self->{features}->{quotedkeys}) {
$fragment =~ s/\\(\[|\]|\/|\\)/$1/g;
warn "Quote '$fragment'\n" if $self->{debug};
if (ref($entry) ne "HASH") {
if (@_) {
return shift;
}
confess "cannot find hash value at '$context' for parameter '$key'";
}
if (!exists $entry->{$fragment}) {
if (@_) {
return shift;
}
confess "cannot find hash value at '$context' for parameter '$key'";
}
$entry = $entry->{$fragment};
} else {
warn "NonQuote '$fragment'\n" if $self->{debug};
if ($fragment =~ /((?:\w|-|\.)+)/) {
if (ref($entry) ne "HASH") {
if (@_) {
return shift;
}
confess "cannot find hash value at '$context' for parameter '$key'";
}
if (!exists $entry->{$fragment}) {
if (@_) {
return shift;
}
confess "cannot find hash value at '$context' for parameter '$key'";
}
$entry = $entry->{$fragment};
} else {
confess "fragment '$fragment' should be alphanumeric, or an array index";
}
}
}
return $entry;
lib/Config/Record.pm view on Meta::CPAN
}
my $entry = $self->{record};
my $context;
while (defined (my $fragment = shift @key)) {
$context = defined $context ? $context . "/" . $fragment : $fragment;
if ($fragment =~ /^\[(\d+)\]$/) {
my $index = $1;
if (ref($entry) ne "ARRAY") {
confess "cannot find array value at $context for parameter $key";
}
if (@key) {
lib/Config/Record.pm view on Meta::CPAN
}
} else {
$entry->[$index] = $value;
}
} elsif ($self->{features}->{quotedkeys}) {
$fragment =~ s/\\(\[|\]|\/|\\)/$1/g;
warn "Quote '$fragment'\n" if $self->{debug};
if (ref($entry) ne "HASH") {
confess "cannot find hash value at $context for parameter $key";
}
if (@key) {
if (exists $entry->{$fragment}) {
$entry = $entry->{$fragment};
} else {
if ($key[0] =~ /^\[(\d+)\]$/) {
$entry->{$fragment} = [];
} else {
$entry->{$fragment} = {};
}
$entry = $entry->[$fragment];
}
} else {
$entry->{$fragment} = $value;
}
} else {
warn "NonQuote '$fragment'\n" if $self->{debug};
if ($fragment =~ /((?:\w|-|\.)+)/) {
if (ref($entry) ne "HASH") {
confess "cannot find hash value at $context for parameter $key";
}
if (@key) {
if (exists $entry->{$fragment}) {
$entry = $entry->{$fragment};
} else {
if ($key[0] =~ /^\[(\d+)\]$/) {
$entry->{$fragment} = [];
} else {
$entry->{$fragment} = {};
}
$entry = $entry->[$fragment];
}
} else {
$entry->{$fragment} = $value;
}
} else {
confess "fragment '$fragment' should be alphanumeric, or an array index";
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.10 Fri Jan 11 00:09:39 EST 2013
Now uses ->param(), ->vars() and ->get_block() methods
for overloading, rather than addressing internal data
structure directly. This is intended to make this
module less fragile to changes in inherited Config::Simple.
Now also uses File::PathInfo to provide an absolute path
and interacts with config files using an absolute path.
Also accepts a debug key on the interface, using that to be
informative about what it is up to.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Source.pm view on Meta::CPAN
sub save_file {
my ( $this, $file, %p ) = @_;
croak 'No user file spezified' if not $file;
# a little bit optimised ;) - but fragile base class!
my $hash = ( $p{include} or $p{exclude} )
? $this->getall( %p )
: $this->{_}
;
view all matches for this distribution
view release on metacpan or search on metacpan
t/04-write.t view on Meta::CPAN
$config = Config::Trivial::Storable->new();
my $data = {
test => "womble",
longer_key => "muppet",
'silly key' => 'fraggle'
}; # New Data
ok($config->write(
config_file => "./t/test3.data",
configuration => $data)); # Write it too
ok(-e "./t/test3.data");
t/04-write.t view on Meta::CPAN
ok($config = Config::Trivial::Storable->new(
config_file => "./t/test3.data")); # Create Config object
ok($config->read("test"), "womble");
ok($config->read('longer_key'), 'muppet');
ok($config->read('silly_key'), 'fraggle');
#
# Make sure we clean up (16-19)
#
ok(unlink("./t/test2.data", "./t/test2.data~", "./t/test3.data"), 3);
ok(! -e "./t/test2.data");
view all matches for this distribution
view release on metacpan or search on metacpan
t/04-write.t view on Meta::CPAN
$config = Config::Trivial->new();
my $data = {
test => "womble",
longer_key => "muppet",
'silly key' => 'fraggle'
}; # New Data
ok($config->write(
config_file => "./t/test3.data",
configuration => $data)); # Write it too
ok(-e "./t/test3.data");
t/04-write.t view on Meta::CPAN
ok($config = Config::Trivial->new(
config_file => "./t/test3.data")); # Create Config object
ok($config->read("test"), "womble");
ok($config->read('longer_key'), 'muppet');
ok($config->read('silly_key'), 'fraggle');
ok($config->set_configuration($data));
#
# Make sure we clean up (16-19)
view all matches for this distribution
view release on metacpan or search on metacpan
libucl-0.8.1/tests/schema/refRemote.json view on Meta::CPAN
"valid": false
}
]
},
{
"description": "fragment within remote ref",
"schema": {"$ref": "http://highsecure.ru/ucl-schema/remotes/subSchemas.json#/integer"},
"tests": [
{
"description": "remote fragment valid",
"data": 1,
"valid": true
},
{
"description": "remote fragment invalid",
"data": "a",
"valid": false
}
]
},
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
inc/Module/AutoInstall.pm view on Meta::CPAN
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Configd.pm view on Meta::CPAN
my $language = $class->language( $name, %opts );
my $unit = Configd::Unit->new( language => $language, %opts );
my @files;
foreach my $file ( $language->files() ) {
my @fragments = $language->fragments($file);
push @files, {
path => $file->{path},
adopted => ( scalar grep { basename($_) eq '00-original' } @fragments ) ? 1 : 0,
fragments => [ map { basename($_) } @fragments ],
};
}
return {
language => $language->name(),
lib/Configd.pm view on Meta::CPAN
=over 4
=item * F</etc/postfix/main.cf> becomes B<generated output>.
=item * F</etc/postfix/main.cf.d/> appears beside it, holding fragments in
main.cf's own syntax.
=item * Whatever was in main.cf becomes C<main.cf.d/00-original>, so the
distribution's defaults and anything the administrator had done keep winning
wherever nothing later has an opinion.
=item * A systemd drop-in regenerates the file every time the service starts or
reloads, so what the daemon reads is always what the fragments say.
=back
Two domains can then each write their own file and both get what they asked for:
lib/Configd.pm view on Meta::CPAN
=head2 Which settings merge, and which do not
This is the whole design decision, and it is per setting.
Most are B<values>: two fragments setting C<myhostname> disagree, and the later
one wins. Some are B<lists>: two fragments each naming a domain in
C<mydestination> both meant it, and joining them is the only answer that does not
lose one. A language says which is which by overriding C<accumulates>.
L<Configd::Language::postfix> deliberately does B<not> accumulate
C<smtpd_recipient_restrictions> and its relatives, even though they are lists.
They are I<ordered> lists where the order is the meaning, and joining two end to
end produces something that parses and that neither fragment asked for -- a
C<permit_> landing ahead of a check that was supposed to run first is an open
relay. Two fragments disagreeing about a restriction list is something a person
should look at.
=head2 Caveats
B<Comments are not carried into the generated file.> A comment is anchored to
the setting below it, and once several fragments have had their say there may be
no such setting any more -- reproducing the distribution's paragraph above a
value that has since been replaced tells the reader something untrue. They stay
in the fragment they were written in, and C<00-original> keeps every one the file
arrived with.
B<Editing the generated file works until the next restart.> That is deliberate:
long enough to test something, short enough that nobody comes to rely on it. The
header on the file says so.
lib/Configd.pm view on Meta::CPAN
adopting, because a service starting is not the time to be taking files over.
=head2 adopt($name, %opts)
Take a language's files over and wrap its service: move each file into its own
fragment directory as C<00-original>, generate it, and install the drop-in.
Returns a hashref of what happened, which is what the command line prints. Its
C<services> is what to restart, which is not always what the drop-in went on --
see L<Configd::Language/services()>.
lib/Configd.pm view on Meta::CPAN
=head2 release($name, %opts)
Give a language's files back: restore each C<00-original> and remove the
drop-in.
The fragment directories are left alone. They are somebody's configuration, and
throwing them away on the way out means a release followed by an adopt loses
everything that was ever added.
=head2 status($name, %opts)
What a language is doing right now: its files, whether each is adopted, how many
fragments it has, and whether the drop-in is in place.
=head1 SEE ALSO
Please see those modules/websites for more information related to this module.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/fatpacked.plackup view on Meta::CPAN
$env->{REQUEST_METHOD} = $method;
$env->{SERVER_PROTOCOL} = "HTTP/$major.$minor";
$env->{REQUEST_URI} = $uri;
my($path, $query) = ( $uri =~ /^([^?]*)(?:\?(.*))?$/s );
for ($path, $query) { s/\#.*$// if defined && length } # dumb clients sending URI fragments
$env->{PATH_INFO} = URI::Escape::uri_unescape($path);
$env->{QUERY_STRING} = $query || '';
$env->{SCRIPT_NAME} = '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Context/Preserve.pm view on Meta::CPAN
Sometimes you need to call a function, get the results, act on the
results, then return the result of the function. This is painful
because of contexts; the original function can behave different if
it's called in void, scalar, or list context. You can ignore the
various cases and just pick one, but that's fragile. To do things
right, you need to see which case you're being called in, and then
call the function in that context. This results in 3 code paths,
which is a pain to type in (and maintain).
This module automates the process. You provide a coderef that is the
view all matches for this distribution
view release on metacpan or search on metacpan
eg/jquery.js view on Meta::CPAN
// Move to the right depth
while ( wrap[0]-- )
div = div.lastChild;
// Remove IE's autoinserted <tbody> from table fragments
if ( jQuery.browser.msie ) {
// String was a <table>, *may* have spurious <tbody>
var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
div.firstChild && div.firstChild.childNodes :
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Control/CLI.pm view on Meta::CPAN
########################################## Internal Private Methods ##########################################
sub _check_query { # Internal method to process Query Device Status escape sequences
my ($self, $pkgsub, $bufRef) = @_;
if (length $self->{QUERYBUFFER}) { # If an escape sequence fragment was cashed
$$bufRef = join('', $self->{QUERYBUFFER}, $$bufRef); # prepend it to new output
$self->{QUERYBUFFER} = '';
}
if ($$bufRef =~ /(\e(?:\[.?)?)$/){ # If output stream ends with \e, or \e[ or \e[.
# We could be looking at an escape sequence fragment; we check if it partially matches $VT100_QueryDeviceStatus
my $escFrag = $1;
if ($VT100_QueryDeviceStatus =~ /^\Q$escFrag\E/){ # If it does,
$$bufRef =~ s/\Q$escFrag\E$//; # we strip it
$self->{QUERYBUFFER} .= $escFrag; # and cache it
}
lib/Control/CLI.pm view on Meta::CPAN
[Return_reference => $flag,]
[Binmode => $binmode,]
[Errmode => $errmode,]
);
If blocking is enabled - see blocking() - this method implements an initial blocking read followed by a number of non-blocking reads. The intention is that we expect to receive at least some data and then we wait a little longer to make sure we have ...
For the initial blocking read, if no data is available, the method will wait until expiry of timeout. If a timeout occurs, then the error mode action is performed as with the regular read() method in blocking mode. See errmode().
If blocking is disabled then no initial blocking read is performed, instead the method will move directly to the non-blocking reads (in this case the "timeout" and "errmode" arguments are not applicable).
Once some data has been read or blocking is disabled, then the method will perform a number of non-blocking reads at certain time intervals to ensure that any subsequent data is also read before returning.
The time interval is by default 100 milliseconds and can be either set via the readwait_timer() method or by specifying the optional "readwait_timer" argument which will override whatever value is globally set for the object. See readwait_timer().
The number of non-blocking reads is dependent on whether more data is received or not but a certain number of consecutive reads with no more data received will make the method return. By default that number is 5 and can be either set via the read_att...
lib/Control/CLI.pm view on Meta::CPAN
die $obj->errmsg unless defined $ok; # Timeout
$output .= $partialOutput;
}
print "Complete command output:\n", $output;
Note that $partialOutput returned will always terminate at output line boundaries (i.e. you can be sure that the last line is complete and not a fragment waiting for more output from device) so the output can be safely parsed for any seeked informato...
=item *
If you only want to retrieve the command output at the end:
view all matches for this distribution
view release on metacpan or search on metacpan
ctlib/parser.y view on Meta::CPAN
int moo(const (T(int)));
...
Where again the '(' immediately to the left of 'T' is interpreted as
being the start of a parameter type list, and not as a redundant
paren around a redeclaration of T. Hence an equivalent code fragment
is:
typedef float T;
int noo(const int identifier1 (T identifier2 [5]));
int moo(const int identifier1 (T identifier2 (int identifier3)));
view all matches for this distribution
view release on metacpan or search on metacpan
<langSet xml:lang="en" id="cid429">
<descrip type="definition">lexeme made up of a sequence of lexemes that has properties that are not predictable from the properties of the individual lexemes or their normal mode of combination</descrip>
<admin type="source">ISO 24613 : 2006</admin>
<descrip type="definition">Alt.def: </descrip>
<admin type="source"/>
<note>Example: to kick the bucket, which means to die rather than to hit a bucket with one's foot. NOTE: An MWE can be a compound, a fragment of a sentence, or a sentence. The group of lexemes making up an MWE can be continuous or discontin...
<note/>
<note>Lupe - The Note has been extracted from ISO/DIS 24611 MAF</note>
<transacGrp>
<transac type="transactionType">origination</transac>
<transacNote type="responsibility">Lindsay Martin (lindsay)</transacNote>
<term id="tid566">MWE</term>
<termNote type="partOfSpeech">Noun</termNote>
<termNote type="termType">abbreviation</termNote>
<termNote type="administrativeStatus"/>
<termNote type="pronunciation"/>
<note>An MWE can be a compound, a fragment of a sentence, or a sentence. The group of lexemes making up an MWE can be continuous or discontinuous. It is not always possible to mark an MWE with a part of speech.</note>
<note/>
</tig>
</langSet>
</termEntry>
<termEntry id="aid302">
<note/>
<note/>
</tig>
</langSet>
<langSet xml:lang="fr" id="cid458">
<descrip type="definition">(ingénierie linguistique) regroupement systématique de textes exploitables par une machine ou de fragments de texte préparés, codés et stockés selon des règles prédéfinies</descrip>
<admin type="source">ISO 01087-2 : 2000</admin>
<descrip type="definition">Alt.def: </descrip>
<admin type="source"/>
<note/>
<note/>
<descrip type="subjectField">Unassigned</descrip>
<note/>
<langSet xml:lang="en" id="cid1185">
<descrip type="definition"/>
<admin type="source">ISO/TS 24617-5</admin>
<descrip type="definition">Alt.def: process of communication, consisting of one or more sentences or sentence fragments</descrip>
<admin type="source"/>
<note>From an abstract viewpoint, data (e.g. words, phrases, sentences and paragraphs) representing a communication process are regarded as discourses. A discourse may be encoded in various media such as text, hypertext, audio, video and th...
<note/>
<note>In the TS, the comment apperas as a NOte, but I have preferred to maintain the information previously included about Frequency: 31</note>
<transacGrp>
<transac type="transactionType">modification</transac>
<transacNote type="responsibility">Juliana Gaubert (juliana)</transacNote>
<date>2009-02-18 03:30:58</date>
</transacGrp>
<tig>
<term id="tid1748">fragment identifier</term>
<termNote type="partOfSpeech">Noun</termNote>
<termNote type="termType"/>
<termNote type="administrativeStatus">Proposed</termNote>
<termNote type="pronunciation"/>
<note/>
<note/>
<descrip type="context">A fragment identifier is defined by IETF/RFC 3986 as an optional component of a URI reference, and it must conform to a certain syntax.</descrip>
<admin type="source">ISO/CD 24618</admin>
</tig>
</langSet>
<langSet xml:lang="fr" id="cid1511">
<descrip type="definition">Un identificateur de fragment est une chaîne de caractères faisant référence à ou indiquant l'emplacement d'une information qui est une fonction d'une ressource. Il suit le symbole dièse (#) et se trouve apr...
<admin type="source">Research</admin>
<descrip type="definition">Alt.def: </descrip>
<admin type="source"/>
<note/>
<note/>
<transac type="transactionType">modification</transac>
<transacNote type="responsibility">Juliana Gaubert (juliana)</transacNote>
<date>2008-11-17 19:36:45</date>
</transacGrp>
<tig>
<term id="tid1831">identificateur de fragment</term>
<termNote type="partOfSpeech">Noun</termNote>
<termNote type="termType"/>
<termNote type="administrativeStatus">Proposed</termNote>
<termNote type="pronunciation"/>
<note/>
<note>masculine</note>
<descrip type="context">La sémantique de l'identificateur de fragment dépend du type de média du résultat de l'extraction de l'URI.</descrip>
<admin type="source">Researchhttp://xslt.free.fr/cadre_lang_xslt.html</admin>
</tig>
</langSet>
</termEntry>
<termEntry id="aid1355">
<transac type="transactionType">modification</transac>
<transacNote type="responsibility">Lupe Aguado (lupe)</transacNote>
<date>2013-09-01 16:48:37</date>
</transacGrp>
<tig>
<term id="tid2601">fragment identifier</term>
<termNote type="partOfSpeech">Noun</termNote>
<termNote type="termType"/>
<termNote type="administrativeStatus"/>
<termNote type="pronunciation"/>
<note/>
<termNote type="termType"/>
<termNote type="administrativeStatus"/>
<termNote type="pronunciation"/>
<note/>
<note/>
<descrip type="context">B's utterance in the example dialogue fragment in (3.2) signals that he is uncertain whether he understood the previous utterance correctly</descrip>
<admin type="source">ISO/DIS 24617-2</admin>
</tig>
</langSet>
</termEntry>
<termEntry id="aid1510">
<termNote type="termType"/>
<termNote type="administrativeStatus"/>
<termNote type="pronunciation"/>
<note>The condition of being âminimal' ensures that functional segments do not include material that does not contribute to the expression of a communicative function that identifies the segment</note>
<note/>
<descrip type="context">The functional segment corresponding to the answer given by S in the following dialogue fragment does not include the parts "Just a moment please" and â.... let me see..." but only the parts âthe first train to...
<admin type="source">ISO/DIS 24617-2</admin>
</tig>
</langSet>
</termEntry>
<termEntry id="aid1517">
view all matches for this distribution
view release on metacpan or search on metacpan
uulib/configure view on Meta::CPAN
*) ac_file_in="${ac_file}.in" ;;
esac
echo creating $ac_file
rm -f conftest.frag conftest.in conftest.out
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
cat $ac_file_inputs > conftest.in
EOF
uulib/configure view on Meta::CPAN
while :
do
ac_lines=`grep -c . conftest.vals`
# grep -c gives empty output for an empty file on some AIX systems.
if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
# Write a limited-size here document to conftest.frag.
echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
echo 'CEOF
sed -f conftest.frag conftest.in > conftest.out
rm -f conftest.in
mv conftest.out conftest.in
' >> $CONFIG_STATUS
sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
rm -f conftest.vals
mv conftest.tail conftest.vals
done
rm -f conftest.vals
cat >> $CONFIG_STATUS <<\EOF
rm -f conftest.frag conftest.h
echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
cat conftest.in >> conftest.h
rm -f conftest.in
if cmp -s $ac_file conftest.h 2>/dev/null; then
echo "$ac_file is unchanged"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Convos/public/js/convos.chat.js view on Meta::CPAN
};
$.fn.attachEventsToMessage = function() {
this.find('a.internal').click(function(e) {
e.preventDefault();
$.pjax.click(e, { container: 'div.messages', fragment: 'div.messages' });
});
this.find('a.autocomplete').click(function(e) {
var str = this.href.match(/.*complete:\/\/(.+)/);
str = str ? str[1] : $(this).text();
if (str.indexOf('/') != 0 && convos.input.val().length == 0) str += ':';
lib/Convos/public/js/convos.chat.js view on Meta::CPAN
};
var initPjax = function() {
$.pjax.defaults.maxCacheLength = 0; // Will refresh conversation when going back/forward, fixes #111
$(document).on('pjax:timeout', function(e) { e.preventDefault(); });
$(document).pjax('nav ul a', 'div.messages', { fragment: 'div.messages' });
$(document).pjax('.sidebar-right a', 'div.messages', { fragment: 'div.messages' });
$('div.messages').on('pjax:beforeReplace', function(xhr, options) { $('body').removeClass('loading'); });
$('div.messages').on('pjax:beforeSend', function(xhr, options) { return !$(this).hasClass('no-pjax'); });
$('div.messages').on('pjax:start', function(xhr, options) { $('body').addClass('loading'); });
view all matches for this distribution